Multisite: Bump `last_changed` cache on site update and creation
When a site is added, updated, or deleted, the `site_ids` cache for a query will no longer be reliable. Bumping `last_changed` will force a new query for site IDs. See #35791. git-svn-id: https://develop.svn.wordpress.org/trunk@37618 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
caf0e9a151
commit
014fda7a20
|
@ -465,6 +465,8 @@ function clean_blog_cache( $blog ) {
|
||||||
* @param string $domain_path_key md5 hash of domain and path.
|
* @param string $domain_path_key md5 hash of domain and path.
|
||||||
*/
|
*/
|
||||||
do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );
|
do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key );
|
||||||
|
|
||||||
|
wp_cache_set( 'last_changed', microtime(), 'sites' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1147,6 +1147,8 @@ function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $s
|
||||||
*/
|
*/
|
||||||
do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta );
|
do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta );
|
||||||
|
|
||||||
|
wp_cache_set( 'last_changed', microtime(), 'sites' );
|
||||||
|
|
||||||
return $blog_id;
|
return $blog_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue