Last active
February 21, 2019 15:24
-
-
Save strangerstudios/8074796 to your computer and use it in GitHub Desktop.
Hide the discount code fields on the Paid Memberships Pro checkout page unless a discount code is already used. Add this to your active theme's functions.php or into a custom (pmpro-customizations.php) plugin.
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
| //hide discount code field unless one is present | |
| function my_pmpro_show_discount_code($show) { | |
| if(!empty($_REQUEST['discount_code']) || !empty($discount_code)) { | |
| $show = true; | |
| } else { | |
| $show = false; | |
| } | |
| return $show; | |
| } | |
| add_filter("pmpro_show_discount_code", "my_pmpro_show_discount_code"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment