[wp_update_user hook]
-
hi folks,
i am trying to create a hook to add to my theme functions.php file which sends an email notification to the admin when a user update their profile.
as you can see below i have managed to get the work half done (i.e. prepare the message and pass the details of the updates), however i would like to pass also the details *before the update* (in my case the old_user_data).
the code below passes the new info. can anyone suggest how to pick up the details before the update is actually performed?
function user_profile_update($userid, $old_user_data) { $userdata = get_userdata($userid); $message = "A user profile has been updated\n\n"; foreach($_POST as $key => $value){ $message .= $key . ": ". $value ."\n"; } //$message .= print_r($userdata,true); $message .= "old data\n\n"; $message .= print_r($old_user_data,true); @wp_mail(get_option('admin_email'), 'User Profile Update', $message); } add_action('profile_update','user_profile_update');
thanks
lorenzo
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘[wp_update_user hook]’ is closed to new replies.