Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active February 21, 2019 15:24
Show Gist options
  • Select an option

  • Save strangerstudios/8074796 to your computer and use it in GitHub Desktop.

Select an option

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.
//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