mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Users: Revert use of shared objects for current user.
Reverts [50790]. Props oztaser, ravipatel, dd32, costdev, SergeyBiryukov, tykoted, cu121, xknown. Fixes #54984. git-svn-id: https://develop.svn.wordpress.org/trunk@54397 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1873,15 +1873,10 @@ function update_user_caches( $user ) {
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @since 4.4.0 'clean_user_cache' action was added.
|
||||
* @since 5.8.0 Refreshes the global user instance if cleaning the user cache for the current user.
|
||||
*
|
||||
* @global WP_User $current_user The current user object which holds the user data.
|
||||
*
|
||||
* @param WP_User|int $user User object or ID to be cleaned from the cache
|
||||
*/
|
||||
function clean_user_cache( $user ) {
|
||||
global $current_user;
|
||||
|
||||
if ( is_numeric( $user ) ) {
|
||||
$user = new WP_User( $user );
|
||||
}
|
||||
@@ -1907,13 +1902,6 @@ function clean_user_cache( $user ) {
|
||||
* @param WP_User $user User object.
|
||||
*/
|
||||
do_action( 'clean_user_cache', $user->ID, $user );
|
||||
|
||||
// Refresh the global user instance if the cleaning current user.
|
||||
if ( get_current_user_id() === (int) $user->ID ) {
|
||||
$user_id = (int) $user->ID;
|
||||
$current_user = null;
|
||||
wp_set_current_user( $user_id, '' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user