retrieve_password_key
Action HookDescription
Fires when a password reset key is generated.Hook Information
File Location |
wp-includes/user.php
View on GitHub
|
Hook Type | Action |
Line Number | 3054 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$user_login
|
The username for the user. |
string
|
$key
|
The generated password reset key. |
Usage Examples
Basic Usage
<?php
// Hook into retrieve_password_key
add_action('retrieve_password_key', 'my_custom_function', 10, 2);
function my_custom_function($user_login, $key) {
// Your custom code here
}
Source Code Context
wp-includes/user.php:3054
- How this hook is used in WordPress core
<?php
3049 * @since 2.5.0
3050 *
3051 * @param string $user_login The username for the user.
3052 * @param string $key The generated password reset key.
3053 */
3054 do_action( 'retrieve_password_key', $user->user_login, $key );
3055
3056 $hashed = time() . ':' . wp_fast_hash( $key );
3057
3058 $key_saved = wp_update_user(
3059 array(
PHP Documentation
<?php
/**
* Fires when a password reset key is generated.
*
* @since 2.5.0
*
* @param string $user_login The username for the user.
* @param string $key The generated password reset key.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-includes/user.php
Related Hooks
Related hooks will be displayed here in future updates.