retrieve_password_message

Filters the message body of the password reset mail.

Description

apply_filters( 'retrieve_password_message', (string) $message, (string) $key, (string) $user_login, (WP_User) $user_data ); 

Parameters (4)

0. $message (string)
Default mail message.
1. $key (string)
The activation key.
2. $user_login (string)
The username for the user.
3. $user_data (WP_User)
WP_User object.

Usage

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

Defined (1)

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

/wp-login.php  
  1. $message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );