lostpassword_post
Action HookDescription
Fires before errors are returned from a password reset request.Hook Information
File Location |
wp-includes/user.php
View on GitHub
|
Hook Type | Action |
Line Number | 3221 |
Hook Parameters
Type | Name | Description |
---|---|---|
WP_Error
|
$errors
|
A WP_Error object containing any errors generated by using invalid credentials. |
WP_User|false
|
$user_data
|
WP_User object if found, false if the user does not exist. |
Usage Examples
Basic Usage
<?php
// Hook into lostpassword_post
add_action('lostpassword_post', 'my_custom_function', 10, 2);
function my_custom_function($errors, $user_data) {
// Your custom code here
}
Source Code Context
wp-includes/user.php:3221
- How this hook is used in WordPress core
<?php
3216 *
3217 * @param WP_Error $errors A WP_Error object containing any errors generated
3218 * by using invalid credentials.
3219 * @param WP_User|false $user_data WP_User object if found, false if the user does not exist.
3220 */
3221 do_action( 'lostpassword_post', $errors, $user_data );
3222
3223 /**
3224 * Filters the errors encountered on a password reset request.
3225 *
3226 * The filtered WP_Error object may, for example, contain errors for an invalid
PHP Documentation
<?php
/**
* Fires before errors are returned from a password reset request.
*
* @since 2.1.0
* @since 4.4.0 Added the `$errors` parameter.
* @since 5.4.0 Added the `$user_data` parameter.
*
* @param WP_Error $errors A WP_Error object containing any errors generated
* by using invalid credentials.
* @param WP_User|false $user_data WP_User object if found, false if the user does not exist.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-includes/user.php
Related Hooks
Related hooks will be displayed here in future updates.