From a6de56b4731b5f1d8619bf1e7ee73360678e9a34 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Thu, 2 Jun 2016 00:59:27 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@37618 git-svn-id: http://core.svn.wordpress.org/trunk@37586 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-blogs.php | 2 ++ wp-includes/ms-functions.php | 2 ++ wp-includes/version.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index 346d10afd3..82a1206dd0 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -465,6 +465,8 @@ function clean_blog_cache( $blog ) { * @param string $domain_path_key md5 hash of domain and path. */ do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key ); + + wp_cache_set( 'last_changed', microtime(), 'sites' ); } /** diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 84a4063488..83b1791674 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -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 ); + wp_cache_set( 'last_changed', microtime(), 'sites' ); + return $blog_id; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 427731053b..d0f541c05e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37617'; +$wp_version = '4.6-alpha-37618'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.