Changeset 54397 for trunk/src/wp-includes/user.php
- Timestamp:
- 10/06/2022 04:36:46 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r54329 r54397 1874 1874 * @since 3.0.0 1875 1875 * @since 4.4.0 'clean_user_cache' action was added. 1876 * @since 5.8.0 Refreshes the global user instance if cleaning the user cache for the current user.1877 *1878 * @global WP_User $current_user The current user object which holds the user data.1879 1876 * 1880 1877 * @param WP_User|int $user User object or ID to be cleaned from the cache 1881 1878 */ 1882 1879 function clean_user_cache( $user ) { 1883 global $current_user;1884 1885 1880 if ( is_numeric( $user ) ) { 1886 1881 $user = new WP_User( $user ); … … 1908 1903 */ 1909 1904 do_action( 'clean_user_cache', $user->ID, $user ); 1910 1911 // Refresh the global user instance if the cleaning current user.1912 if ( get_current_user_id() === (int) $user->ID ) {1913 $user_id = (int) $user->ID;1914 $current_user = null;1915 wp_set_current_user( $user_id, '' );1916 }1917 1905 } 1918 1906
Note: See TracChangeset
for help on using the changeset viewer.