Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save femiyb/4cc6d55c668404c5d4e4e90d2a0a2333 to your computer and use it in GitHub Desktop.
Save femiyb/4cc6d55c668404c5d4e4e90d2a0a2333 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'] ) ) {
?>
<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