Skip to content

Commit

Permalink
Delete proper cache keys
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Jan 27, 2023
1 parent 2d91cbd commit 8a47ba6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/wp-includes/global-styles-and-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ function wp_get_global_settings( $path = array(), $context = array() ) {
$path = $new_path;
}

// This is the default value when no origin is provided or when it is 'all'.
/*
* This is the default value when no origin is provided or when it is 'all'.
*
* The $origin is used as part of the cache key. Changes here need to account
* for clearing the cache appropiately.
*/
$origin = 'custom';
if (
! wp_theme_has_theme_json() ||
Expand Down Expand Up @@ -363,6 +368,7 @@ function wp_theme_has_theme_json() {
*/
function wp_clean_theme_json_cache() {
wp_cache_delete( 'wp_get_global_stylesheet', 'theme_json' );
wp_cache_delete( 'wp_get_global_settings', 'theme_json' );
wp_cache_delete( 'wp_get_global_settings_custom', 'theme_json' );
wp_cache_delete( 'wp_get_global_settings_theme', 'theme_json' );
WP_Theme_JSON_Resolver::clean_cached_data();
}

0 comments on commit 8a47ba6

Please sign in to comment.