Last active
February 15, 2021 14:08
-
-
Save rynaldos-zz/edeb6c82904267d19538f1e49ce26894 to your computer and use it in GitHub Desktop.
filter the countries where the VAT number field will show up for
This file contains 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
add_filter( 'woocommerce_eu_vat_number_country_codes', 'woo_custom_eu_vat_number_country_codes' ); | |
function woo_custom_eu_vat_number_country_codes( $vat_countries ) { | |
// only show field for users in BE | |
return array( 'BE' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you need to remove a couple of countries use array_diff passing an array of the country codes you wish to remove as the second param, no need to loop and unset values.
As @jakecausier mentioned pass the modified array through array_values to reindex the values.