Users: Make sure wp_logout() clears current user, so that a subsequent call to is_user_logged_in() works as expected.

Props sebastian.pisula, donmhico, roytanck, juliobox.
Fixes #35488.

git-svn-id: https://develop.svn.wordpress.org/trunk@46467 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-10-12 03:08:56 +00:00
parent 572934992f
commit a8259b8c5e
2 changed files with 16 additions and 3 deletions

View File

@@ -571,6 +571,7 @@ if ( ! function_exists( 'wp_logout' ) ) :
function wp_logout() {
wp_destroy_current_session();
wp_clear_auth_cookie();
wp_set_current_user( 0 );
/**
* Fires after a user is logged-out.