Skip to content

Instantly share code, notes, and snippets.

@JarrydLong
Created January 21, 2021 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JarrydLong/7a2b0733a88f9d74057fde2388aac3d5 to your computer and use it in GitHub Desktop.
Save JarrydLong/7a2b0733a88f9d74057fde2388aac3d5 to your computer and use it in GitHub Desktop.
<?php
/**
* This recipe will remove the UK 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_uk_from_eu( $countries ){
unset( $countries['GB'] );
return $countries;
}
add_filter( 'pmpro_vat_by_country', 'mypmpro_remove_uk_from_eu', 10, 1 );
add_filter( 'pmpro_european_union', 'mypmpro_remove_uk_from_eu', 10, 1 );
@laurenhagan0306
Copy link

This recipe is included in the blog post on "UK Leaves the EU: What Changes in the VAT Add On" at Paid Memberships Pro here: https://www.paidmembershipspro.com/uk-leaves-eu-vat-add-on-pmpro-update/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment