Login/Registration: Pass the error data to the `wp_login_failed` action.
Props hamedmoodi, rixeo. Fixes #49007. Built from https://develop.svn.wordpress.org/trunk@46971 git-svn-id: http://core.svn.wordpress.org/trunk@46771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a79636f82a
commit
d273235abd
|
@ -547,15 +547,19 @@ if ( ! function_exists( 'wp_authenticate' ) ) :
|
||||||
$ignore_codes = array( 'empty_username', 'empty_password' );
|
$ignore_codes = array( 'empty_username', 'empty_password' );
|
||||||
|
|
||||||
if ( is_wp_error( $user ) && ! in_array( $user->get_error_code(), $ignore_codes ) ) {
|
if ( is_wp_error( $user ) && ! in_array( $user->get_error_code(), $ignore_codes ) ) {
|
||||||
|
$error = $user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires after a user login has failed.
|
* Fires after a user login has failed.
|
||||||
*
|
*
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
* @since 4.5.0 The value of `$username` can now be an email address.
|
* @since 4.5.0 The value of `$username` can now be an email address.
|
||||||
|
* @since 5.4.0 The `$error` parameter was added.
|
||||||
*
|
*
|
||||||
* @param string $username Username or email address.
|
* @param string $username Username or email address.
|
||||||
|
* @param WP_Error $error A WP_Error object with the authentication failure details.
|
||||||
*/
|
*/
|
||||||
do_action( 'wp_login_failed', $username );
|
do_action( 'wp_login_failed', $username, $error );
|
||||||
}
|
}
|
||||||
|
|
||||||
return $user;
|
return $user;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.4-alpha-46970';
|
$wp_version = '5.4-alpha-46971';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue