password_reset_key_expired

Filters the return value of check_password_reset_key() when an old-style key is used.

Description

apply_filters( 'password_reset_key_expired', (WP_Error) $return, (int) $user_id ); 

Parameters (2)

0. $return (WP_Error)
A WP_Error object denoting an expired key. Return a WP_User object to validate the key.
1. $user_id (int)
The matched user ID.

Usage

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

Defined (1)

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

/wp-includes/user.php  
  1. return apply_filters( 'password_reset_key_expired', $return, $user_id );