apply_filters( 'authenticate', null|WP_User|WP_Error $user, string $username, string $password )
- Since
- 2.8.0, 4.5.0
Filters whether a set of user login credentials are valid.
Description
A WP_User object is returned if the credentials authenticate a user.WP_Error or null otherwise.
Parameters
$usernull|WP_User|WP_Error- WP_User if the user is authenticated. WP_Error or null otherwise.
$usernamestring- Username or email address.
$passwordstring- User password.
Fired at · 1
wp-includes/pluggable.php:706wp_authenticate()
Source
* * @param null|WP_User|WP_Error $user WP_User if the user is authenticated. * WP_Error or null otherwise. * @param string $username Username or email address. * @param string $password User password. */ $user = apply_filters( 'authenticate', null, $username, $password ); if ( null === $user || false === $user ) { /* * TODO: What should the error message be? (Or would these even happen?) * Only needed if all authentication handlers fail to return anything. */History
Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.5.0
$username now accepts an email address.from the docblock2.8.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.