Authenticates the user using the WordPress auth cookie.
Parameters
Source
);
}
if ( wp_password_needs_rehash( $user->user_pass, $user->ID ) ) {
wp_set_password( $password, $user->ID );
}
return $user;
}
/**
* Authenticates the user using the WordPress auth cookie.
*
* @since 2.8.0
*
* @global string $auth_secure_cookie
*
* @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null.
* @param string $username Username. If not empty, cancels the cookie authentication.
* @param string $password Password. If not empty, cancels the cookie authentication.
* @return WP_User|WP_Error WP_User on success, WP_Error on failure.
*/
function wp_authenticate_cookie(
$user,
$username,
#[\SensitiveParameter]
$password
) {
Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.