apply_filters( 'wp_authenticate_user', WP_User|WP_Error $user , string $password )
Filters whether the given user can be authenticated with the provided password.
Contents
Parameters
More Information
This hook should return either a WP_User() object or, if generating an error, a WP_Error() object.
Source
File: wp-includes/user.php
.
View all references
$user = apply_filters( 'wp_authenticate_user', $user, $password );
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example Code:
Top ↑
Feedback
Replace:
With:
It will save many headaches. — By peps23 —
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.