Changeset 54548 for branches/5.8/src/wp-includes/user.php
- Timestamp:
- 10/17/2022 05:46:39 PM (2 years ago)
- Location:
- branches/5.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
- Property svn:mergeinfo changed
/trunk merged: 54397,54521-54530,54541
- Property svn:mergeinfo changed
-
branches/5.8/src/wp-includes/user.php
r51411 r54548 1572 1572 * @since 3.0.0 1573 1573 * @since 4.4.0 'clean_user_cache' action was added. 1574 * @since 5.8.0 Refreshes the global user instance if cleaning the user cache for the current user.1575 *1576 * @global WP_User $current_user The current user object which holds the user data.1577 1574 * 1578 1575 * @param WP_User|int $user User object or ID to be cleaned from the cache 1579 1576 */ 1580 1577 function clean_user_cache( $user ) { 1581 global $current_user;1582 1583 1578 if ( is_numeric( $user ) ) { 1584 1579 $user = new WP_User( $user ); … … 1603 1598 */ 1604 1599 do_action( 'clean_user_cache', $user->ID, $user ); 1605 1606 // Refresh the global user instance if the cleaning current user.1607 if ( get_current_user_id() === (int) $user->ID ) {1608 $user_id = (int) $user->ID;1609 $current_user = null;1610 wp_set_current_user( $user_id, '' );1611 }1612 1600 } 1613 1601
Note: See TracChangeset
for help on using the changeset viewer.