validate_password_reset
Action HookDescription
Fires before the password reset procedure is validated.Hook Information
File Location |
wp-login.php
View on GitHub
|
Hook Type | Action |
Line Number | 999 |
Hook Parameters
Type | Name | Description |
---|---|---|
WP_Error
|
$errors
|
WP Error object. |
WP_User|WP_Error
|
$user
|
WP_User object if the login and reset key match. WP_Error object otherwise. |
Usage Examples
Basic Usage
<?php
// Hook into validate_password_reset
add_action('validate_password_reset', 'my_custom_function', 10, 2);
function my_custom_function($errors, $user) {
// Your custom code here
}
Source Code Context
wp-login.php:999
- How this hook is used in WordPress core
<?php
994 * @since 3.5.0
995 *
996 * @param WP_Error $errors WP Error object.
997 * @param WP_User|WP_Error $user WP_User object if the login and reset key match. WP_Error object otherwise.
998 */
999 do_action( 'validate_password_reset', $errors, $user );
1000
1001 if ( ( ! $errors->has_errors() ) && isset( $_POST['pass1'] ) && ! empty( $_POST['pass1'] ) ) {
1002 reset_password( $user, $_POST['pass1'] );
1003 setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
1004 login_header(
PHP Documentation
<?php
/**
* Fires before the password reset procedure is validated.
*
* @since 3.5.0
*
* @param WP_Error $errors WP Error object.
* @param WP_User|WP_Error $user WP_User object if the login and reset key match. WP_Error object otherwise.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-login.php
Related Hooks
Related hooks will be displayed here in future updates.