From 170a2cc4bea5c012898a3171505cb9b950b45650 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 19 Sep 2015 05:41:26 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@34318 git-svn-id: http://core.svn.wordpress.org/trunk@34282 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user-functions.php | 11 +++++++++++ wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/wp-includes/user-functions.php b/wp-includes/user-functions.php index 8015d1c3c1..856ca673c8 100644 --- a/wp-includes/user-functions.php +++ b/wp-includes/user-functions.php @@ -1090,6 +1090,7 @@ function update_user_caches($user) { * Clean all user caches * * @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 */ @@ -1104,6 +1105,16 @@ function clean_user_cache( $user ) { wp_cache_delete( $user->user_login, 'userlogins' ); wp_cache_delete( $user->user_email, 'useremail' ); 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 ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 01ca7d89dc..6e44a9680a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34317'; +$wp_version = '4.4-alpha-34318'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.