Multisite: Fire a `clean_site_cache` action when a site's cache is cleared

Props spacedmonkey.
Fixes #36203.

Built from https://develop.svn.wordpress.org/trunk@37204


git-svn-id: http://core.svn.wordpress.org/trunk@37170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2016-04-14 04:19:27 +00:00
parent f74e50d1dd
commit 8d5c62b923
2 changed files with 12 additions and 1 deletions

View File

@ -454,6 +454,17 @@ function clean_blog_cache( $blog ) {
wp_cache_delete( 'current_blog_' . $blog->domain . $blog->path, 'site-options' ); wp_cache_delete( 'current_blog_' . $blog->domain . $blog->path, 'site-options' );
wp_cache_delete( 'get_id_from_blogname_' . trim( $blog->path, '/' ), 'blog-details' ); wp_cache_delete( 'get_id_from_blogname_' . trim( $blog->path, '/' ), 'blog-details' );
wp_cache_delete( $domain_path_key, 'blog-id-cache' ); wp_cache_delete( $domain_path_key, 'blog-id-cache' );
/**
* Fires immediately after a site has been removed from the object cache.
*
* @since 4.6.0
*
* @param int $id Blog ID.
* @param WP_Site $blog
* @param string $domain_path_key md5 hash of domain and path.
*/
do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );
} }
/** /**

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.6-alpha-37203'; $wp_version = '4.6-alpha-37204';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.