Filters whether a set of user login credentials are valid.
A WP_User object is returned if the credentials authenticate a user.
WP_Error or null otherwise.
The authenticate filter hook is used to perform additional validation/authentication any time a user logs in to WordPress.
The wp_authenticate_user filter can also be used if you want to perform any additional validation after WordPress’s basic validation, but before a user is logged in.
The default authenticate filters in /wp-includes/default-filters.php
add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
add_filter( 'authenticate', 'wp_authenticate_email_password', 20, 3 );
add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 ); $user = apply_filters( 'authenticate', null, $username, $password );
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/authenticate