Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Last active September 23, 2020 15:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andrewlimaza/f74ebad17c1ec3c9d9ef77cf56b05e32 to your computer and use it in GitHub Desktop.
Save andrewlimaza/f74ebad17c1ec3c9d9ef77cf56b05e32 to your computer and use it in GitHub Desktop.
Remove variable pricing check when discount code is applied. [Paid Memberships Pro]
<?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