function wp_password_change_notification(&$user) {}

Notify the blog admin of a user changing password, normally via email.


  • object $user: User Object
  • &$user

Source code

function wp_password_change_notification(&$user) {

	// send a copy of password change notification to the admin

	// but check to see if it's the admin whose password we're changing, and skip this

	if ( $user->user_email != get_option('admin_email') ) {

		$message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n";

		// The blogname option is escaped with esc_html on the way into the database in sanitize_option

		// we want to reverse this for the plain text arena of emails.

		$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

		wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), $blogname), $message);




No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: