From 4fc4a033c90ead3de9ad9042d43f3a0079fbc8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Tue, 14 Sep 2021 15:03:30 +0200 Subject: [PATCH] Clean theme data when switching themes in the customizer (#34540) * Clean theme data when switching themes in the customizer * Hook into setup_theme instead of switch_theme * Hook into switch_theme & start_previewing_theme --- lib/class-wp-theme-json-resolver-gutenberg.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/class-wp-theme-json-resolver-gutenberg.php b/lib/class-wp-theme-json-resolver-gutenberg.php index a208cbd726d88..0b86721fa7baa 100644 --- a/lib/class-wp-theme-json-resolver-gutenberg.php +++ b/lib/class-wp-theme-json-resolver-gutenberg.php @@ -531,3 +531,4 @@ public static function clean_cached_data() { } add_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver_Gutenberg', 'clean_cached_data' ) ); +add_action( 'start_previewing_theme', array( 'WP_Theme_JSON_Resolver_Gutenberg', 'clean_cached_data' ) );