Skip to content

Commit

Permalink
Do not use cache if WP_DEBUG is active
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Nov 25, 2022
1 parent 5f3a905 commit a8b2676
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/compat/wordpress-6.2/get-global-styles-and-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ function gutenberg_get_global_settings( $path = array(), $context = array() ) {
$cache_key = 'gutenberg_get_global_settings_' . $origin;
$settings = wp_cache_get( $cache_key, $cache_group );

if ( false === $settings ) {
if (
false === $settings ||
( defined( 'WP_DEBUG' ) && WP_DEBUG )
) {
$settings = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data( $origin )->get_settings();
wp_cache_set( $cache_key, $settings, $cache_group );
}
Expand Down

0 comments on commit a8b2676

Please sign in to comment.