wp_authenticate_user filter-hookWP 2.5.0

Filters whether the given user can be authenticated with the provided password.

Usage

add_filter( 'wp_authenticate_user', 'wp_kama_authenticate_user_filter', 10, 2 );

/**
 * Function for `wp_authenticate_user` filter-hook.
 * 
 * @param WP_User|WP_Error $user     WP_User or WP_Error object if a previous callback failed authentication.
 * @param string           $password Password to check against the user.
 *
 * @return WP_User|WP_Error
 */
function wp_kama_authenticate_user_filter( $user, $password ){

	// filter...
	return $user;
}
$user(WP_User|WP_Error)
WP_User or WP_Error object if a previous callback failed authentication.
$password(string)
Password to check against the user.

Changelog

Since 2.5.0 Introduced.

Where the hook is called

wp_authenticate_username_password()
wp_authenticate_user
wp_authenticate_email_password()
wp_authenticate_user
wp-includes/user.php 180
$user = apply_filters( 'wp_authenticate_user', $user, $password );
wp-includes/user.php 251
$user = apply_filters( 'wp_authenticate_user', $user, $password );

Where the hook is used in WordPress

Usage not found.