Filters whether the given user can be authenticated with the provided password.
Parameters
Source
$user = apply_filters( 'wp_authenticate_user', $user, $password );
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
CARVIEW |
Filters whether the given user can be authenticated with the provided password.
This hook should return either a WP_User() object or, if generating an error, a WP_Error() object.
$user = apply_filters( 'wp_authenticate_user', $user, $password );
Used by | Description |
---|---|
wp_authenticate_email_password()wp-includes/user.php | Authenticates a user using the email and password. |
wp_authenticate_username_password()wp-includes/user.php | Authenticates a user, confirming the username and password are valid. |
Version | Description |
---|---|
2.5.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
Example Code:
With:
It will save many headaches.
A basic usage example
This hook passes two parameters, $user and $password (plaintext). In order to generate an error on login, you will need to return a new WP_Error() object.