Clean - User - Cache - Function - WordPress Developer Resources

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

06/08/23, 00:06 clean_user_cache() | Function | WordPress Developer Resources

clean_user_cache() | Function |
WordPress Developer Resources
Cleans all user caches.

$userWP_User|intRequired

User object or ID to be cleaned from the cache

File: wp-includes/user.php. View all references

function clean_user_cache( $user ) {if ( is_numeric( $user ) ) {$user = new WP_User( $user );}if ( !

View on TracView on GitHub

do_action( 'clean_user_cache', int $user_id, WP_User $user )


Fires immediately after the given user’s cache is cleaned.

Changelog
Version Description
6.2.0 User metadata caches are now cleared.
4.4.0 'clean_user_cache' action was added.

3.0.0 Introduced.

https://developer.wordpress.org/reference/functions/clean_user_cache/ 1/2
06/08/23, 00:06 clean_user_cache() | Function | WordPress Developer Resources

https://developer.wordpress.org/reference/functions/clean_user_cache/ 2/2

You might also like