From 5ffa617678e7998ebd87b42952603a7599f954b9 Mon Sep 17 00:00:00 2001 From: Darren Ethier Date: Fri, 22 Jul 2022 15:07:57 -0400 Subject: [PATCH] clean static cache for new variable --- .../class-wp-theme-json-resolver-gutenberg.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/experimental/class-wp-theme-json-resolver-gutenberg.php b/lib/experimental/class-wp-theme-json-resolver-gutenberg.php index 792a51ac0ab6a1..75cd272e2dfdd8 100644 --- a/lib/experimental/class-wp-theme-json-resolver-gutenberg.php +++ b/lib/experimental/class-wp-theme-json-resolver-gutenberg.php @@ -235,4 +235,22 @@ public static function get_merged_data( $origin = 'custom' ) { return $result; } + + /** + * Cleans the cached data so it can be recalculated. + * + * @since 5.8.0 + * @since 5.9.0 Added the `$user`, `$user_custom_post_type_id`, + * and `$i18n_schema` variables to reset. + * @since 6.1.0 Added the `$plugins` variables to reset. + */ + public static function clean_cached_data() { + static::$core = null; + static::$theme = null; + static::$user = null; + static::$user_custom_post_type_id = null; + static::$theme_has_support = null; + static::$i18n_schema = null; + static::$plugins = null; + } }