Last active
July 21, 2021 06:55
-
-
Save strangerstudios/5ce592b1387210c0cc8b76b90aa2d9cc to your computer and use it in GitHub Desktop.
Hide discount code field on the PMPro checkout page for specified levels.
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
function hide_discount_code_field_for_specific_levels($show) | |
{ | |
global $pmpro_level; | |
if( in_array( $pmpro_level->id, array(1,2) ) ) | |
{ | |
$show = false; | |
} | |
return $show; | |
} | |
add_filter('pmpro_show_discount_code', 'hide_discount_code_field_for_specific_levels'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "Hide “Discount Code” field on Membership Checkout for Free or Specified Levels"at Paid Memberships Pro here: https://www.paidmembershipspro.com/hide-discount-code-field-on-membership-checkout-for-free-levels/