I am utilizing the code beneath that I discovered in one other thread. When a consumer makes modifications to their profile, this snippet sends an e mail notification that one thing has been modified. I might prefer to amend this in order that we may be notified which fields particularly (Title, e mail, telephone, and so forth) have been modified. Is there a easy solution to obtain this by amending this code?
I am fairly new to php and coding i normal so please clarify like I am dumb. Thanks a lot
add_action( 'personal_options_update', 'notify_admin_on_update' );
add_action( 'edit_user_profile_update','notify_admin_on_update');
operate notify_admin_on_update(){
world $current_user;
get_currentuserinfo();
if (!current_user_can( 'administrator' )){// keep away from sending emails when admin is updating consumer profiles
$to = 'e mail@e mail.com';
$topic = 'consumer up to date profile';
$message = "the user : " .$current_user->display_name . " has updated his profile with:n";
foreach($_POST as $key => $worth){
$message .= $key . ": ". $worth ."n";
}
wp_mail( $to, $topic, $message);
}
}