Created
February 7, 2023 09:36
-
-
Save dwanjuki/93331ac5c300f98523538128092212e7 to your computer and use it in GitHub Desktop.
Change Admin Activity emails recipient from Site Admin to the specified email address
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 | |
/** | |
* The function below will change the recipient of Admin Activity Emails. | |
* | |
* 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/ | |
*/ | |
function my_pmpro_redirect_admin_activity_emails( $recipient, $email ) { | |
if ( $email->template == "admin_activity_email" ) { | |
$recipient = "[email protected]"; // New admin activity recipient email goes here | |
} | |
return $recipient; | |
} | |
add_filter( 'pmpro_email_recipient', 'my_pmpro_redirect_admin_activity_emails', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment