update_user_caches() WordPress Function
The update_user_caches() function is used to update the user caches. This function is called when a user is updated.
update_user_caches( object|WP_User $user ) #
Updates all user caches.
Parameters
- $user
(object|WP_User)(Required)User object or database row to be cached
Return
(void|false) Void on success, false on failure.
Source
File: wp-includes/user.php
function update_user_caches( $user ) { if ( $user instanceof WP_User ) { if ( ! $user->exists() ) { return false; } $user = $user->data; } wp_cache_add( $user->ID, $user, 'users' ); wp_cache_add( $user->user_login, $user->ID, 'userlogins' ); wp_cache_add( $user->user_email, $user->ID, 'useremail' ); wp_cache_add( $user->user_nicename, $user->ID, 'userslugs' ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |