Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimwhite/a3e5e5ce98ce8a09df767527ca011633 to your computer and use it in GitHub Desktop.
Save kimwhite/a3e5e5ce98ce8a09df767527ca011633 to your computer and use it in GitHub Desktop.
<?php
/**
* This recipe will remove the Non-EU Resident from list from the list of EU countries to validate VAT numbers.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function mypmpro_remove_from_eu( $countries ){
unset( $countries['NOTEU'] );
return $countries;
}
add_filter( 'pmpro_vat_by_country', 'mypmpro_remove_from_eu', 10, 1 );
add_filter( 'pmpro_european_union', 'mypmpro_remove_from_eu', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment