is it possible to sign in with user_email instead of user_login, please ?
Thanks.
is it possible to sign in with user_email instead of user_login, please ?
Thanks.
Here’s how we do it:
$user = get_user_by('email', $email);
if (wp_check_password($password, $user->user_pass, $user->ID)) {
// Login successfull, redirect if needed
wp_set_auth_cookie($user->ID);
}
Assuming of course that you got the $email and the $password variables from a POST request or something 🙂