Last active
June 23, 2026 07:52
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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