Forked from JarrydLong/mypmpro-dont-vlidate-uk-tax.php
Created
June 30, 2026 08:01
-
-
Save dwanjuki/441cdca6a06a949203bea7744c0ca236 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?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