password_reset_key_expired
Filter HookDescription
Filters the return value of check_password_reset_key() when an old-style key or an expired key is used.Hook Information
File Location |
wp-includes/user.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3152 |
Hook Parameters
Type | Name | Description |
---|---|---|
WP_Error
|
$return
|
A WP_Error object denoting an expired key. Return a WP_User object to validate the key. |
int
|
$user_id
|
The matched user ID. |
Usage Examples
Basic Usage
<?php
// Hook into password_reset_key_expired
add_filter('password_reset_key_expired', 'my_custom_filter', 10, 2);
function my_custom_filter($return, $user_id) {
// Your custom filtering logic here
return $return;
}
Source Code Context
wp-includes/user.php:3152
- How this hook is used in WordPress core
<?php
3147 *
3148 * @param WP_Error $return A WP_Error object denoting an expired key.
3149 * Return a WP_User object to validate the key.
3150 * @param int $user_id The matched user ID.
3151 */
3152 return apply_filters( 'password_reset_key_expired', $return, $user_id );
3153 }
3154
3155 return new WP_Error( 'invalid_key', __( 'Invalid key.' ) );
3156 }
3157
PHP Documentation
<?php
/**
* Filters the return value of check_password_reset_key() when an
* old-style key or an expired key is used.
*
* @since 3.7.0 Previously plain-text keys were stored in the database.
* @since 4.3.0 Previously key hashes were stored without an expiration time.
*
* @param WP_Error $return A WP_Error object denoting an expired key.
* Return a WP_User object to validate the key.
* @param int $user_id The matched user ID.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/user.php
Related Hooks
Related hooks will be displayed here in future updates.