Created
December 16, 2014 21:22
-
-
Save technosailor/4291141273e21c885f6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$user_creds = array( | |
'user_login' => $member_data['member-username'], | |
'user_password' => $member_data['member-password'], | |
//'remember' => false | |
); | |
$user = wp_signon( $user_creds, true ); | |
if( is_wp_error( $user ) ) { | |
$result['redirect'] = site_url( '/login/?error=failed_login' ); | |
} | |
else { | |
file_put_contents( ABSPATH . '/log.txt', print_r( $user, true ) ); | |
//wp_set_current_user( $user->ID, $user->data->user_login ); | |
wp_set_auth_cookie( $user->ID, false, true ); | |
//do_action( 'wp_login', $user->data->user_login ); | |
$result['redirect'] = site_url( '/join/become-a-member/get-started?id=' . $user->ID ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try to hook in
set_auth_cookie
and check, if params are set. If everything is good there thensetcookie
is failing for some reason.