Login with Email and Remember option.

if( isset($_REQUEST[‘action’]) && $_REQUEST[‘action’]==’maillogin’ )


$email = $_REQUEST[‘usermail’]; //username.

$password = $_REQUEST[‘password’];

$remember = $_REQUEST[‘remember’];

$userdata = get_user_by(’email’,$email);

$creds = array();

$creds[‘user_login’] = $userdata->data->user_login;

$creds[‘user_password’] = $password;

$creds[‘remember’] = $remember;

$user = wp_signon( $creds, true );

if ( is_wp_error($user) ){

//echo $user->get_error_message();

echo “false”;



echo “true”;




One Comment

  • PROMOZIONI says:

    Hi! I just would like to give you a enormous thumbs way up for the excellent information you’ve got below about this post. I will be returning to your blog post to get more quickly.

Leave a Reply