diff --git a/lib/experimental/class-wp-theme-json-resolver-gutenberg.php b/lib/experimental/class-wp-theme-json-resolver-gutenberg.php index adf5803de561aa..a4d4e4dfc7066d 100644 --- a/lib/experimental/class-wp-theme-json-resolver-gutenberg.php +++ b/lib/experimental/class-wp-theme-json-resolver-gutenberg.php @@ -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 );