diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index a664a1ea0b..e6eeb8ca5d 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -1974,7 +1974,7 @@ final class WP_Theme implements ArrayAccess { if ( ! $this->exists() ) { return false; } - $pattern_data = wp_cache_get( 'wp_theme_patterns_' . $this->stylesheet ); + $pattern_data = wp_cache_get( 'wp_theme_patterns_' . $this->stylesheet, 'theme_files' ); if ( is_array( $pattern_data ) && $pattern_data['version'] === $this->get( 'Version' ) ) { return $pattern_data['patterns']; } @@ -1993,7 +1993,7 @@ final class WP_Theme implements ArrayAccess { 'version' => $this->get( 'Version' ), 'patterns' => $patterns, ); - wp_cache_set( 'wp_theme_patterns_' . $this->stylesheet, $pattern_data ); + wp_cache_set( 'wp_theme_patterns_' . $this->stylesheet, $pattern_data, 'theme_files' ); } /** @@ -2002,7 +2002,7 @@ final class WP_Theme implements ArrayAccess { * @since 6.4.0 */ public function delete_pattern_cache() { - wp_cache_delete( 'wp_theme_patterns_' . $this->stylesheet ); + wp_cache_delete( 'wp_theme_patterns_' . $this->stylesheet, 'theme_files' ); } /** diff --git a/wp-includes/load.php b/wp-includes/load.php index c188598768..d10aff376f 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -875,6 +875,7 @@ function wp_start_object_cache() { 'site-options', 'site-queries', 'site-transient', + 'theme_files', 'rss', 'users', 'user-queries', diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index 4a251cf300..b9575b3bef 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -565,6 +565,7 @@ function switch_to_blog( $new_blog_id, $deprecated = null ) { 'site-options', 'site-queries', 'site-transient', + 'theme_files', 'rss', 'users', 'user-queries', @@ -658,6 +659,7 @@ function restore_current_blog() { 'site-options', 'site-queries', 'site-transient', + 'theme_files', 'rss', 'users', 'user-queries', diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 0b0df6c7b0..c8cbc60cc6 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -837,8 +837,10 @@ function switch_theme( $stylesheet ) { update_option( 'theme_switched', $old_theme->get_stylesheet() ); // Clear pattern caches. - $new_theme->delete_pattern_cache(); - $old_theme->delete_pattern_cache(); + if ( ! is_multisite() ) { + $new_theme->delete_pattern_cache(); + $old_theme->delete_pattern_cache(); + } // Set autoload=no for the old theme, autoload=yes for the switched theme. $theme_mods_options = array( diff --git a/wp-includes/version.php b/wp-includes/version.php index 02330a5545..487330710a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57607'; +$wp_version = '6.5-alpha-57608'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.