wp_login_failed WordPress Action Hook

The wp_login_failed hook is called when a user has failed to login. It allows for custom handling of this event, such as logging the failure, sending an email to the user, or displaying a message to the user.

do_action( 'wp_login_failed', string $username, WP_Error $error ) #

Fires after a user login has failed.


Parameters

$username

(string)Username or email address.

$error

(WP_Error)A WP_Error object with the authentication failure details.


Top ↑

Source

File: wp-includes/pluggable.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.4.0The $error parameter was added.
4.5.0The value of $username can now be an email address.
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More