wp_login_failed
Fires after a user login has failed.
Usage
add_action( 'wp_login_failed', 'wp_kama_login_failed_action', 10, 2 ); /** * Function for `wp_login_failed` action-hook. * * @param string $username Username or email address. * @param WP_Error $error A WP_Error object with the authentication failure details. * * @return void */ function wp_kama_login_failed_action( $username, $error ){ // action... }
- $username(string)
- Username or email address.
- $error(WP_Error)
- A WP_Error object with the authentication failure details.
Changelog
Since 2.5.0 | Introduced. |
Since 4.5.0 | The value of $username can now be an email address. |
Since 5.4.0 | The $error parameter was added. |
Where the hook is called
wp_login_failed
wp-includes/pluggable.php 643
do_action( 'wp_login_failed', $username, $error );