Last active
May 3, 2018 09:27
-
-
Save saraheolson/2ce0b30d020eeaa42ac4 to your computer and use it in GitHub Desktop.
Email Notification on User Profile Change (WordPress)
This file contains hidden or 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 | |
/** | |
* Add this snippet to your functions.php file | |
*/ | |
function my_admin_notification_profile_update($userid) { | |
$userdata = get_userdata($userid); | |
$message = "A user profile has been updated\n\n"; | |
$message .= print_r($userdata,true); | |
@wp_mail(get_option('admin_email'), 'User Profile Update', $message); | |
} | |
add_action('profile_update','my_admin_notification_profile_update'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment