Forked from andrewlimaza/my-pmpro-change-admin-email.php
Created
November 1, 2022 19:18
-
-
Save michaelbeil/5764cda4d9e99dc6fb713d77b4a0827f to your computer and use it in GitHub Desktop.
Change the admin email for all Paid Memberships Pro admin emails.
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 | |
/** | |
* Change the email address for all admin related emails in Paid Memberships Pro. | |
* Follow this guide to add custom code to your WordPress site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_change_admin_to_email( $user_email, $email ){ | |
if( strpos( $email->template, "_admin" ) !== false ) { | |
$user_email = 'memberadmin@someemail.co'; | |
} | |
return $user_email; | |
} | |
add_filter( "pmpro_email_recipient", "my_pmpro_change_admin_to_email", 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment