Created
December 4, 2017 10:37
-
-
Save andrewlimaza/fbe8acbc7aca3768028e3fa8b0fbfa70 to your computer and use it in GitHub Desktop.
Hide Discount Code For PMPro Level
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 | |
/** | |
* Hide discount code link on checkout for a specific level Paid Memberships Pro. | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Visit www.paidmembershipspro.com for more info. | |
*/ | |
function pmpro_hide_discount_level_5() { | |
global $pmpro_pages; | |
// Remove discount fields if checkout level is '5'. Change to any membership level ID you want to hide discount from. | |
if( is_page( $pmpro_pages['checkout'] ) && $_REQUEST['level'] == 5 ) { | |
?> | |
<style type="text/css"> | |
#other_discount_code_p{ display:none; } | |
.pmpro_payment-discount-code{ display:none; } | |
</style> | |
<?php | |
} | |
} | |
add_action( 'wp_footer', 'pmpro_hide_discount_level_5' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment