Skip to content

Instantly share code, notes, and snippets.

@femiyb
Last active February 24, 2021 12:52
Show Gist options
  • Save femiyb/a692dceb01e96e449a17f89e821aa580 to your computer and use it in GitHub Desktop.
Save femiyb/a692dceb01e96e449a17f89e821aa580 to your computer and use it in GitHub Desktop.
<?php
/**
* This sends PMPro admin emails to another email.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
//Change PMPro admin email
function my_pmpro_forward_admin_emails($recipient, $email)
{
if(strpos($email->template, '_admin'))
$recipient = '[email protected]';
return $recipient;
}
add_filter("pmpro_email_recipient", "my_pmpro_forward_admin_emails", 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment