Customize login process in woocommerce and wordpress.
$customfield = $_POST['phone_number'];
$UsermetaData = get_users('meta_value='.$customfield); //print_r($UsermetaData); foreach($UsermetaData as $userdata){ $user = $userdata->ID; }
if (!is_wp_error($user))
{
wp_clear_auth_cookie();
wp_set_current_user($user);
wp_set_auth_cookie($user);
$redirect_to = user_admin_url();
wp_safe_redirect( user_admin_url() );
exit();
}
return $user;
Comments
Post a Comment