login
-
I have a progamatic login system for users. This works fine
But when im in admin, and select a user and try and programatically login , it ignores me!
Code below….
wp_clearcookie();
do_action(‘wp_logout’);
nocache_headers();
$user = get_user_by(‘id’, $userid );
if( $user ) {
wp_set_current_user( $user_id, $user->user_login );
wp_set_auth_cookie( $userid );
do_action( ‘wp_login’, $user->user_login);
header(“location:”.get_site_url().”/patient-menu/”);
exit;
}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘login’ is closed to new replies.