Skip to content

Instantly share code, notes, and snippets.

@femiyb
Last active March 26, 2019 17:18
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/425a7d57fbb5f389ca15cbdc1c817078 to your computer and use it in GitHub Desktop.
Save femiyb/425a7d57fbb5f389ca15cbdc1c817078 to your computer and use it in GitHub Desktop.
<?php
/*
Disable the "Admin Checkout" emails in Paid Memberships Pro
*/
function my_pmpro_email_recipient($recipient, $email)
{
$user = get_user_by( $email, $recipient );
$user_level = pmpro_getMembershipLevelForUser( $user );
if(($email->template == "checkout_paid_admin" || $email->template == "checkout_free_admin") && ($user_level->ID == '4')) //could check for a different template here
$recipient = NULL;
return $recipient;
}
add_filter("pmpro_email_recipient", "my_pmpro_email_recipient", 10, 2);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment