Add a 'clean_user_cache'
action at the end of clean_user_cache()
. This is mighty similar to clean_post_cache()
.
Props elliott-stocks, wonderboymusic. Fixes #31918. git-svn-id: https://develop.svn.wordpress.org/trunk@34318 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
51078c32ec
commit
09e3149b7a
@ -1090,6 +1090,7 @@ function update_user_caches($user) {
|
|||||||
* Clean all user caches
|
* Clean all user caches
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
|
* @since 4.4.0 'clean_user_cache' action was added.
|
||||||
*
|
*
|
||||||
* @param WP_User|int $user User object or ID to be cleaned from the cache
|
* @param WP_User|int $user User object or ID to be cleaned from the cache
|
||||||
*/
|
*/
|
||||||
@ -1104,6 +1105,16 @@ function clean_user_cache( $user ) {
|
|||||||
wp_cache_delete( $user->user_login, 'userlogins' );
|
wp_cache_delete( $user->user_login, 'userlogins' );
|
||||||
wp_cache_delete( $user->user_email, 'useremail' );
|
wp_cache_delete( $user->user_email, 'useremail' );
|
||||||
wp_cache_delete( $user->user_nicename, 'userslugs' );
|
wp_cache_delete( $user->user_nicename, 'userslugs' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fires immediately after the given user's cache is cleaned.
|
||||||
|
*
|
||||||
|
* @since 4.4.0
|
||||||
|
*
|
||||||
|
* @param int $user_id User ID.
|
||||||
|
* @param WP_User $user User object.
|
||||||
|
*/
|
||||||
|
do_action( 'clean_user_cache', $user->ID, $user );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user