Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created December 4, 2017 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save andrewlimaza/fbe8acbc7aca3768028e3fa8b0fbfa70 to your computer and use it in GitHub Desktop.
Save andrewlimaza/fbe8acbc7aca3768028e3fa8b0fbfa70 to your computer and use it in GitHub Desktop.
Hide Discount Code For PMPro Level
<?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