mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 22:24:36 +00:00
Themes: Add 'theme_files' cache group to block pattern cache operations.
Use 'theme_files' cache group for block pattern caches. Previously, block pattern cache data was not stored in a cache group and used the default group. This new cache group, is setup as a global cache group, meaning that sites using multisite, will have a single cache for block pattern data per theme. This change also no longer invalidate block pattern caches in multisite instances, meaning block pattern caches can be shared between sites on a network, meaning less repeated data in the object cache. Props spacedmonkey, flixos90, joemcgill. Fixes #60120. git-svn-id: https://develop.svn.wordpress.org/trunk@57608 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user