password_change_email

Filters the contents of the email sent when the user's password is changed.

Description

apply_filters( 'password_change_email', (array) $pass_change_email, (array) $user, (array) $userdata ); 

Parameters (3)

0. $pass_change_email (array)
1. $user (array)
The original user array.
2. $userdata (array)
The updated user array.

Usage

To run the hook, copy the example below.
  1. $pass_change_email = apply_filters( 'password_change_email', $pass_change_email, $user, $userdata ); 
  2.  
  3. if ( !empty( $pass_change_email ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the password_change_email callback 
  2. function filter_password_change_email( $pass_change_email, $user, $userdata ) { 
  3. // make filter magic happen here... 
  4. return $pass_change_email
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'password_change_email', 'filter_password_change_email', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'password_change_email', 'filter_password_change_email', 10, 3 ); 

Defined (1)

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

/wp-includes/user.php  
  1. $pass_change_email = apply_filters( 'password_change_email', $pass_change_email, $user, $userdata );