Last active
March 26, 2019 17:18
-
-
Save femiyb/425a7d57fbb5f389ca15cbdc1c817078 to your computer and use it in GitHub Desktop.
This file contains 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
<?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