Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active June 23, 2026 07:52
Show Gist options
  • Select an option

  • Save webtoffee-git/aa5232fd6a8aaa01798093dc334ef520 to your computer and use it in GitHub Desktop.

Select an option

Save webtoffee-git/aa5232fd6a8aaa01798093dc334ef520 to your computer and use it in GitHub Desktop.
Filter to modify EU Withdrawal button visibility - By WebToffee (WebToffee's EU Withdrawal Button plugin)
<?php //do not copy this line of code
// Show Eu withdrawal footer link only in EU countries.
add_filter( 'wbte_ewb_show_footer_withdrawal_link', function ( $show, $country ) {
$eu_countries = array( 'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE' );
return $show && in_array( $country, $eu_countries, true );
}, 10, 2 );
// To Render Eu withdrawal button shortcode [wt_eu_order_withdrawal] only in EU countries.
add_filter( 'wbte_ewb_show_withdrawal_button_shortcode', function ( $show, $country ) {
$eu_countries = array( 'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE' );
return $show && in_array( $country, $eu_countries, true );
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment