wp_password_change_notification

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

Description

wp_password_change_notification( (WP_User) $user ); 

Parameters (1)

0. $user (WP_User)
User object.

Usage

  1. if ( !function_exists( 'wp_password_change_notification' ) ) { 
  2. require_once ABSPATH . WPINC . '/pluggable.php'; 
  3.  
  4. // User object. 
  5. $user = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_password_change_notification($user); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/pluggable.php  
  1. function wp_password_change_notification( $user ) { 
  2. // send a copy of password change notification to the admin 
  3. // but check to see if it's the admin whose password we're changing, and skip this 
  4. if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) { 
  5. /** translators: %s: user name */ 
  6. $message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . "\r\n"; 
  7. // The blogname option is escaped with esc_html on the way into the database in sanitize_option 
  8. // we want to reverse this for the plain text arena of emails. 
  9. $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); 
  10. /** translators: %s: site title */ 
  11. wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Password Changed' ), $blogname ), $message );