retrieve_password
Action HookDescription
Fires before a new password is retrieved.Hook Information
File Location |
wp-includes/user.php
View on GitHub
|
Hook Type | Action |
Line Number | 3034 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$user_login
|
The user login name. |
Usage Examples
Basic Usage
<?php
// Hook into retrieve_password
add_action('retrieve_password', 'my_custom_function', 10, 1);
function my_custom_function($user_login) {
// Your custom code here
}
Source Code Context
wp-includes/user.php:3034
- How this hook is used in WordPress core
<?php
3029 *
3030 * @since 1.5.1
3031 *
3032 * @param string $user_login The user login name.
3033 */
3034 do_action( 'retrieve_password', $user->user_login );
3035
3036 $password_reset_allowed = wp_is_password_reset_allowed_for_user( $user );
3037 if ( ! $password_reset_allowed ) {
3038 return new WP_Error( 'no_password_reset', __( 'Password reset is not allowed for this user' ) );
3039 } elseif ( is_wp_error( $password_reset_allowed ) ) {
PHP Documentation
<?php
/**
* Fires before a new password is retrieved.
*
* @since 1.5.1
*
* @param string $user_login The user login name.
*/
Quick Info
- Hook Type: Action
- Parameters: 1
- File: wp-includes/user.php
Related Hooks
Related hooks will be displayed here in future updates.