Forked from strangerstudios/hide_discount_code_field_for_specific_levels.php
Created
July 21, 2021 06:55
-
-
Save JarrydLong/04e605e429e41848a42b761b06188cf3 to your computer and use it in GitHub Desktop.
Hide discount code field on the PMPro checkout page for specified levels.
This file contains 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 hide_discount_code_field_for_specific_levels($show) | |
{ | |
global $pmpro_level; | |
if( in_array( intval( $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