Last active
September 23, 2020 15:25
-
-
Save andrewlimaza/f74ebad17c1ec3c9d9ef77cf56b05e32 to your computer and use it in GitHub Desktop.
Remove variable pricing check when discount code is applied. [Paid Memberships Pro]
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 | |
/** | |
* Remove variable pricing requirements if a discount code is set. | |
* Follow this guide to add this code snippet to your site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Visit www.paidmembershipspro.com for more information. | |
*/ | |
function my_pmpro_remove_vp_check_discount_code( $continue ) { | |
global $pmpro_level; | |
if ( isset( $pmpro_level->code_id ) ) { | |
remove_filter( 'pmpro_registration_checks', 'pmprovp_pmpro_registration_checks' ); | |
} | |
return $continue; | |
} | |
add_filter( 'pmpro_registration_checks', 'my_pmpro_remove_vp_check_discount_code', 5, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment