wp_password_change_notification( WP_User $user )

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

Description Description

Parameters Parameters


(WP_User) (Required) User object.

Top ↑

Source Source

File: wp-includes/pluggable.php

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 ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
		/* translators: %s: user name */
		$message = sprintf( __( 'Password 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);
		/* translators: %s: site title */
		wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Password Changed' ), $blogname ), $message );

Top ↑

Changelog Changelog

Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.