Skip to content

Instantly share code, notes, and snippets.

@JarrydLong
Last active June 30, 2026 08:01
Show Gist options
  • Select an option

  • Save JarrydLong/6a131f8e442c82074e609eedd348af2b to your computer and use it in GitHub Desktop.

Select an option

Save JarrydLong/6a131f8e442c82074e609eedd348af2b to your computer and use it in GitHub Desktop.
<?php
/**
* This ensures that the UK can be selected from the dropdown to add Tax to the
* membership but will not validate the VAT number.
*
* 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_dont_validate_uk_tax( $valid ){
if( ! empty( $_REQUEST['country'] ) && $_REQUEST['country'] === 'UK' ){
return true;
}
return $valid;
}
add_filter( 'pmprovat_skip_validation', 'mypmpro_dont_validate_uk_tax', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment