Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dwanjuki/441cdca6a06a949203bea7744c0ca236 to your computer and use it in GitHub Desktop.

Select an option

Save dwanjuki/441cdca6a06a949203bea7744c0ca236 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'] ) && 'GB' === $_REQUEST['country'] ) {
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