Skip to content

Commit

Permalink
Theme JSON Resolver: Update cache check to also check that the object…
Browse files Browse the repository at this point in the history
… is an instance of the Gutenberg version (#42756)

* Theme JSON Resolver: Update cache check to also check that the object is an instance of the Gutenberg version

* Add comment for when the resolver is backported to core
  • Loading branch information
andrewserong authored and Mamaduka committed Jul 29, 2022
1 parent 8c8a7a7 commit 0dbe24f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/experimental/class-wp-theme-json-resolver-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public static function get_theme_data( $deprecated = array(), $settings = array(
_deprecated_argument( __METHOD__, '5.9' );
}

if ( null === static::$theme ) {
// When backporting to core, remove the instanceof Gutenberg class check, as it is only required for the Gutenberg plugin.
if ( null === static::$theme || ! static::$theme instanceof WP_Theme_JSON_Gutenberg ) {
$theme_json_data = static::read_json_file( static::get_file_path_from_theme( 'theme.json' ) );
$theme_json_data = static::translate( $theme_json_data, wp_get_theme()->get( 'TextDomain' ) );
$theme_json_data = gutenberg_add_registered_webfonts_to_theme_json( $theme_json_data );
Expand Down

0 comments on commit 0dbe24f

Please sign in to comment.