Last active
March 31, 2020 18:41
-
-
Save ronalfy/5f869abda14b6fa026bc37bf9f6a85db to your computer and use it in GitHub Desktop.
Paid Memberships Pro - Hide Discount Code for Level
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 | |
function my_pmpro_hide_discount_code_for_level( $show ) { | |
if ( empty( $_REQUEST['level'] ) ) { | |
return false; | |
} | |
if ( 1 === absint( $_REQUEST['level'] ) || 2 === absint( $_REQUEST['level'] ) ) { // 1,2 is the level ID. | |
return false; | |
} | |
return $show; | |
} | |
add_filter( 'pmpro_show_discount_code', 'my_pmpro_hide_discount_code_for_level' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment