From 07398378667b6ccd34ef469858f2f8e7a2bc5bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Fri, 4 Nov 2022 10:43:14 +0100 Subject: [PATCH 01/15] Add object caching to wp_theme_has_theme_json --- .../get-global-styles-and-settings.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 4dbd9d0ba8bde1..65d6960c1397cf 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -9,18 +9,16 @@ /** * Whether a theme or its parent have a theme.json file. * - * @param boolean $clear_cache Whether the cache should be cleared and theme support recomputed. Default is false. + * The result would be cached via the WP_Object_Cache + * under the `wp_theme_has_theme_json` key. * * @return boolean */ - function wp_theme_has_theme_json( $clear_cache = false ) { - static $theme_has_support = null; - - if ( true === $clear_cache ) { - $theme_has_support = null; - } - - if ( null !== $theme_has_support ) { + function wp_theme_has_theme_json() { + $cache_key = 'wp_theme_has_theme_json'; + $cache_found = false; + $theme_has_support = wp_cache_get( $cache_key, '', false, $cache_found ); + if ( $cache_found ) { return $theme_has_support; } @@ -32,6 +30,8 @@ function wp_theme_has_theme_json( $clear_cache = false ) { $theme_has_support = is_readable( get_template_directory() . '/theme.json' ); } + wp_cache_set( $cache_key, $theme_has_support ); + return $theme_has_support; } } @@ -41,7 +41,7 @@ function wp_theme_has_theme_json( $clear_cache = false ) { * Clean theme.json related cached data. */ function wp_theme_clean_theme_json_cached_data() { - wp_theme_has_theme_json( true ); + wp_cache_delete( 'wp_theme_has_theme_json' ); WP_Theme_JSON_Resolver_Gutenberg::clean_cached_data(); } } From 6003a43f44d8b7e4b35788463d8d5063fe6c3d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 9 Nov 2022 14:22:23 -0700 Subject: [PATCH 02/15] Add a cache group --- .../wordpress-6.2/get-global-styles-and-settings.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 65d6960c1397cf..4546f7296f0961 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -15,9 +15,10 @@ * @return boolean */ function wp_theme_has_theme_json() { + $cache_group = 'theme_json'; $cache_key = 'wp_theme_has_theme_json'; $cache_found = false; - $theme_has_support = wp_cache_get( $cache_key, '', false, $cache_found ); + $theme_has_support = wp_cache_get( $cache_key, $cache_group, false, $cache_found ); if ( $cache_found ) { return $theme_has_support; } @@ -30,7 +31,7 @@ function wp_theme_has_theme_json() { $theme_has_support = is_readable( get_template_directory() . '/theme.json' ); } - wp_cache_set( $cache_key, $theme_has_support ); + wp_cache_set( $cache_key, $theme_has_support, $cache_group ); return $theme_has_support; } @@ -41,7 +42,7 @@ function wp_theme_has_theme_json() { * Clean theme.json related cached data. */ function wp_theme_clean_theme_json_cached_data() { - wp_cache_delete( 'wp_theme_has_theme_json' ); + wp_cache_delete( 'wp_theme_has_theme_json', 'theme_json' ); WP_Theme_JSON_Resolver_Gutenberg::clean_cached_data(); } } From f58e23b096ca25c5138f252a2cf19624b8493723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 9 Nov 2022 14:43:46 -0700 Subject: [PATCH 03/15] Store int instead of boolean in the cache --- .../get-global-styles-and-settings.php | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 4546f7296f0961..622ebbb194b8df 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -17,23 +17,30 @@ function wp_theme_has_theme_json() { $cache_group = 'theme_json'; $cache_key = 'wp_theme_has_theme_json'; - $cache_found = false; - $theme_has_support = wp_cache_get( $cache_key, $cache_group, false, $cache_found ); - if ( $cache_found ) { - return $theme_has_support; + $theme_has_support = wp_cache_get( $cache_key, $cache_group ); + + /** + * $theme_has_support is stored as a int in the cache. + * + * The reason not to store it as a boolean is to avoid working + * with the $found parameter which apparently had some issues in some implementations + * https://developer.wordpress.org/reference/functions/wp_cache_get/ + */ + if ( 0 === $theme_has_support || 1 === $theme_has_support ) { + return (bool) $theme_has_support; } // Has the own theme a theme.json? - $theme_has_support = is_readable( get_stylesheet_directory() . '/theme.json' ); + $theme_has_support = is_readable( get_stylesheet_directory() . '/theme.json' ) ? 1 : 0; // Look up the parent if the child does not have a theme.json. - if ( ! $theme_has_support ) { - $theme_has_support = is_readable( get_template_directory() . '/theme.json' ); + if ( 0 === $theme_has_support ) { + $theme_has_support = is_readable( get_template_directory() . '/theme.json' ) ? 1 : 0; } wp_cache_set( $cache_key, $theme_has_support, $cache_group ); - return $theme_has_support; + return (bool) $theme_has_support; } } From 20b2d8cba08733f8bf681b2d29e48bd1e5549954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 9 Nov 2022 14:54:58 -0700 Subject: [PATCH 04/15] Do not use the cache if WP_DEBUG is true --- lib/compat/wordpress-6.2/get-global-styles-and-settings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 622ebbb194b8df..53071ccdd3f591 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -26,7 +26,8 @@ function wp_theme_has_theme_json() { * with the $found parameter which apparently had some issues in some implementations * https://developer.wordpress.org/reference/functions/wp_cache_get/ */ - if ( 0 === $theme_has_support || 1 === $theme_has_support ) { + if ( ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) && + ( 0 === $theme_has_support || 1 === $theme_has_support ) ) { return (bool) $theme_has_support; } From e5b1b4103d1437fd9de099d0cc6a58266182bb57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 9 Nov 2022 15:02:23 -0700 Subject: [PATCH 05/15] Update clean cache method to have a single purpose --- lib/compat/wordpress-6.2/default-filters.php | 11 +++-------- .../wordpress-6.2/get-global-styles-and-settings.php | 12 ++++-------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/lib/compat/wordpress-6.2/default-filters.php b/lib/compat/wordpress-6.2/default-filters.php index ac1ce19b425512..baf216147bfa84 100644 --- a/lib/compat/wordpress-6.2/default-filters.php +++ b/lib/compat/wordpress-6.2/default-filters.php @@ -17,11 +17,6 @@ * @package gutenberg */ -/** - * Note for backport: we should also remove the existing filters: - * - * > add_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) ); - * > add_action( 'start_previewing_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) ); - */ -add_action( 'switch_theme', 'wp_theme_clean_theme_json_cached_data' ); -add_action( 'start_previewing_theme', 'wp_theme_clean_theme_json_cached_data' ); +add_action( 'switch_theme', 'wp_theme_has_theme_json_clean_cache' ); +add_action( 'start_previewing_theme', 'wp_theme_has_theme_json_clean_cache' ); +// TODO: clean cache when theme is updated diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 53071ccdd3f591..fc0789e2d62d67 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -9,8 +9,8 @@ /** * Whether a theme or its parent have a theme.json file. * - * The result would be cached via the WP_Object_Cache - * under the `wp_theme_has_theme_json` key. + * The result would be cached via the WP_Object_Cache. + * It can be cleared by calling wp_theme_has_theme_json_clean_cache(). * * @return boolean */ @@ -45,12 +45,8 @@ function wp_theme_has_theme_json() { } } -if ( ! function_exists( 'wp_theme_clean_theme_json_cached_data' ) ) { - /** - * Clean theme.json related cached data. - */ - function wp_theme_clean_theme_json_cached_data() { +if ( ! function_exists( 'wp_theme_has_theme_json_clean_cache' ) ) { + function wp_theme_has_theme_json_clean_cache() { wp_cache_delete( 'wp_theme_has_theme_json', 'theme_json' ); - WP_Theme_JSON_Resolver_Gutenberg::clean_cached_data(); } } From a5e6bdf02cfbd954b6ac9abcbde90065f204ffa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 9 Nov 2022 15:22:07 -0700 Subject: [PATCH 06/15] Clear cache upon upgrading the active theme --- lib/compat/wordpress-6.2/default-filters.php | 2 +- .../get-global-styles-and-settings.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.2/default-filters.php b/lib/compat/wordpress-6.2/default-filters.php index baf216147bfa84..860cf9a8bf412a 100644 --- a/lib/compat/wordpress-6.2/default-filters.php +++ b/lib/compat/wordpress-6.2/default-filters.php @@ -19,4 +19,4 @@ add_action( 'switch_theme', 'wp_theme_has_theme_json_clean_cache' ); add_action( 'start_previewing_theme', 'wp_theme_has_theme_json_clean_cache' ); -// TODO: clean cache when theme is updated +add_action( 'upgrader_process_complete', '_wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme' ); diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index fc0789e2d62d67..23af04b0968f1f 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -50,3 +50,16 @@ function wp_theme_has_theme_json_clean_cache() { wp_cache_delete( 'wp_theme_has_theme_json', 'theme_json' ); } } + +if ( ! function_exists( '_wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme' ) ) { + function _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme( $upgrader, $options ) { + // The cache only needs cleaning when the active theme was updated. + if ( + 'update' === $options[ 'action' ] && + 'theme' === $options[ 'type' ] && + array_key_exists( get_stylesheet(), $options[ 'themes' ] ) + ) { + wp_theme_has_theme_json_clean_cache(); + } + } +} From 57d2df96349e88f4542d0a3e7fde3a420163a7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 9 Nov 2022 17:06:24 -0700 Subject: [PATCH 07/15] Add PHPDoc --- .../wordpress-6.2/get-global-styles-and-settings.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 23af04b0968f1f..6d89f1ad521885 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -46,12 +46,21 @@ function wp_theme_has_theme_json() { } if ( ! function_exists( 'wp_theme_has_theme_json_clean_cache' ) ) { + /** + * Function to clean the cache used by wp_theme_has_theme_json method. + */ function wp_theme_has_theme_json_clean_cache() { wp_cache_delete( 'wp_theme_has_theme_json', 'theme_json' ); } } if ( ! function_exists( '_wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme' ) ) { + /** + * Private function to clean the cache used by wp_theme_has_theme_json method. + * + * @param WP_Upgrader $upgrader Instance of WP_Upgrader class. + * @param array $options Metadata that identifies the data that is updated. + */ function _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme( $upgrader, $options ) { // The cache only needs cleaning when the active theme was updated. if ( From 5473642fea4328c24ad3ab66881127e2065282af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 9 Nov 2022 17:07:36 -0700 Subject: [PATCH 08/15] Fix lint issues --- .../wordpress-6.2/get-global-styles-and-settings.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 6d89f1ad521885..2dc321529790fe 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -59,14 +59,14 @@ function wp_theme_has_theme_json_clean_cache() { * Private function to clean the cache used by wp_theme_has_theme_json method. * * @param WP_Upgrader $upgrader Instance of WP_Upgrader class. - * @param array $options Metadata that identifies the data that is updated. + * @param array $options Metadata that identifies the data that is updated. */ function _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme( $upgrader, $options ) { // The cache only needs cleaning when the active theme was updated. if ( - 'update' === $options[ 'action' ] && - 'theme' === $options[ 'type' ] && - array_key_exists( get_stylesheet(), $options[ 'themes' ] ) + 'update' === $options['action'] && + 'theme' === $options['type'] && + array_key_exists( get_stylesheet(), $options['themes'] ) ) { wp_theme_has_theme_json_clean_cache(); } From f19753448ff73e94ea139507f520c0318b1be82d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 16 Nov 2022 13:16:49 +0100 Subject: [PATCH 09/15] Remove WP_DEBUG behavior --- lib/compat/wordpress-6.2/get-global-styles-and-settings.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 2dc321529790fe..1faf1933676354 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -26,10 +26,6 @@ function wp_theme_has_theme_json() { * with the $found parameter which apparently had some issues in some implementations * https://developer.wordpress.org/reference/functions/wp_cache_get/ */ - if ( ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) && - ( 0 === $theme_has_support || 1 === $theme_has_support ) ) { - return (bool) $theme_has_support; - } // Has the own theme a theme.json? $theme_has_support = is_readable( get_stylesheet_directory() . '/theme.json' ) ? 1 : 0; From 0aa8ce3d2ce997625f55b7673d96dac68213fab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 16 Nov 2022 16:53:31 +0100 Subject: [PATCH 10/15] Brinch back cache retrieval --- lib/compat/wordpress-6.2/get-global-styles-and-settings.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 1faf1933676354..ddcfdc11b379e2 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -26,6 +26,9 @@ function wp_theme_has_theme_json() { * with the $found parameter which apparently had some issues in some implementations * https://developer.wordpress.org/reference/functions/wp_cache_get/ */ + if ( ( 0 === $theme_has_support || 1 === $theme_has_support ) ) { + return (bool) $theme_has_support; + } // Has the own theme a theme.json? $theme_has_support = is_readable( get_stylesheet_directory() . '/theme.json' ) ? 1 : 0; From ee310d744eb2744f4c7f823cf633ba11a8f0cb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 16 Nov 2022 16:56:47 +0100 Subject: [PATCH 11/15] Update lib/compat/wordpress-6.2/get-global-styles-and-settings.php Co-authored-by: Felix Arntz --- lib/compat/wordpress-6.2/get-global-styles-and-settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index ddcfdc11b379e2..18bf3630237a4b 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -65,7 +65,7 @@ function _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme( $upgr if ( 'update' === $options['action'] && 'theme' === $options['type'] && - array_key_exists( get_stylesheet(), $options['themes'] ) + isset( $options['themes'][ get_stylesheet() ] ) ) { wp_theme_has_theme_json_clean_cache(); } From ffee4e18d205ff2fa48683fc1bcce0000a5b0dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 16 Nov 2022 17:05:06 +0100 Subject: [PATCH 12/15] Fix lint issue --- lib/compat/wordpress-6.2/get-global-styles-and-settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 18bf3630237a4b..24f515d78e6824 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -65,7 +65,7 @@ function _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme( $upgr if ( 'update' === $options['action'] && 'theme' === $options['type'] && - isset( $options['themes'][ get_stylesheet() ] ) + isset( $options['themes'][ get_stylesheet() ] ) ) { wp_theme_has_theme_json_clean_cache(); } From 961528fbf6e585dc9cdaef8924e702391ab2fa79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Thu, 17 Nov 2022 10:31:42 +0100 Subject: [PATCH 13/15] Update lib/compat/wordpress-6.2/get-global-styles-and-settings.php Co-authored-by: Felix Arntz --- lib/compat/wordpress-6.2/get-global-styles-and-settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index 24f515d78e6824..e50f014a9411da 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -26,7 +26,7 @@ function wp_theme_has_theme_json() { * with the $found parameter which apparently had some issues in some implementations * https://developer.wordpress.org/reference/functions/wp_cache_get/ */ - if ( ( 0 === $theme_has_support || 1 === $theme_has_support ) ) { + if ( 0 === $theme_has_support || 1 === $theme_has_support ) { return (bool) $theme_has_support; } From af3ecb91a82104c94d120de241ea3ace9c9220fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Thu, 17 Nov 2022 10:32:15 +0100 Subject: [PATCH 14/15] Update lib/compat/wordpress-6.2/get-global-styles-and-settings.php Co-authored-by: Felix Arntz --- lib/compat/wordpress-6.2/get-global-styles-and-settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index e50f014a9411da..e7ed9a02a45fb0 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -65,7 +65,7 @@ function _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme( $upgr if ( 'update' === $options['action'] && 'theme' === $options['type'] && - isset( $options['themes'][ get_stylesheet() ] ) + ( isset( $options['themes'][ get_stylesheet() ] ) || isset( $options['themes'][ get_template() ] ) ) ) { wp_theme_has_theme_json_clean_cache(); } From 52680774012e48fb3742afcb489f913a55656702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Thu, 17 Nov 2022 11:20:39 +0100 Subject: [PATCH 15/15] Update lib/compat/wordpress-6.2/get-global-styles-and-settings.php Co-authored-by: Miguel Torres --- lib/compat/wordpress-6.2/get-global-styles-and-settings.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php index e7ed9a02a45fb0..b2637969fd8ef6 100644 --- a/lib/compat/wordpress-6.2/get-global-styles-and-settings.php +++ b/lib/compat/wordpress-6.2/get-global-styles-and-settings.php @@ -57,6 +57,10 @@ function wp_theme_has_theme_json_clean_cache() { /** * Private function to clean the cache used by wp_theme_has_theme_json method. * + * It is hooked into the `upgrader_process_complete` action. + * + * @see default-filters.php + * * @param WP_Upgrader $upgrader Instance of WP_Upgrader class. * @param array $options Metadata that identifies the data that is updated. */