Skip to content

Instantly share code, notes, and snippets.

@zorem
Created August 5, 2019 09:31
Show Gist options
  • Save zorem/1743d8e9cd8ec5cbe0e1eb31390aac9e to your computer and use it in GitHub Desktop.
Save zorem/1743d8e9cd8ec5cbe0e1eb31390aac9e to your computer and use it in GitHub Desktop.
Just use below snippet by using this snippet you can maintaining login status after successful login. You just need to add this snippet code in a function.php file if you want to maintain login status.
add_action( "wcalr_after_login", 'wcalr_after_login_func', 10, 1 );
function wcalr_after_login_func($user_signon){
wp_set_current_user($user_signon->ID);
wp_set_auth_cookie($user_signon->ID);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment