Changeset 54545 for branches/5.9/src/wp-includes/user.php
- Timestamp:
- 10/17/2022 05:39:34 PM (3 years ago)
- Location:
- branches/5.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/user.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.9
- Property svn:mergeinfo changed
/trunk merged: 54397,54521-54530,54541
- Property svn:mergeinfo changed
-
branches/5.9/src/wp-includes/user.php
r52398 r54545 1711 1711 * @since 3.0.0 1712 1712 * @since 4.4.0 'clean_user_cache' action was added. 1713 * @since 5.8.0 Refreshes the global user instance if cleaning the user cache for the current user.1714 *1715 * @global WP_User $current_user The current user object which holds the user data.1716 1713 * 1717 1714 * @param WP_User|int $user User object or ID to be cleaned from the cache 1718 1715 */ 1719 1716 function clean_user_cache( $user ) { 1720 global $current_user;1721 1722 1717 if ( is_numeric( $user ) ) { 1723 1718 $user = new WP_User( $user ); … … 1742 1737 */ 1743 1738 do_action( 'clean_user_cache', $user->ID, $user ); 1744 1745 // Refresh the global user instance if the cleaning current user.1746 if ( get_current_user_id() === (int) $user->ID ) {1747 $user_id = (int) $user->ID;1748 $current_user = null;1749 wp_set_current_user( $user_id, '' );1750 }1751 1739 } 1752 1740
Note: See TracChangeset
for help on using the changeset viewer.