From 26bf59946ea220b2efaec5a136a331be4ff6bd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Thu, 22 Dec 2022 17:04:24 +0100 Subject: [PATCH] experimental: port webfonts (experimental API) see https://github.com/WordPress/gutenberg/pull/37140 --- lib/class-wp-theme-json-resolver.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/class-wp-theme-json-resolver.php b/lib/class-wp-theme-json-resolver.php index d7638bfb5155d4..581a792878c907 100644 --- a/lib/class-wp-theme-json-resolver.php +++ b/lib/class-wp-theme-json-resolver.php @@ -245,6 +245,9 @@ public static function get_theme_data( $deprecated = array(), $options = array() } else { $theme_json_data = array(); } + // BEGIN OF EXPERIMENTAL CODE. Not to backport to core. + $theme_json_data = gutenberg_add_registered_webfonts_to_theme_json( $theme_json_data ); + // END OF EXPERIMENTAL CODE. /** * Filters the data provided by the theme for global styles and settings. @@ -263,7 +266,10 @@ public static function get_theme_data( $deprecated = array(), $options = array() if ( '' !== $parent_theme_json_file ) { $parent_theme_json_data = static::read_json_file( $parent_theme_json_file ); $parent_theme_json_data = static::translate( $parent_theme_json_data, $wp_theme->parent()->get( 'TextDomain' ) ); - $parent_theme = new WP_Theme_JSON_Gutenberg( $parent_theme_json_data ); + // BEGIN OF EXPERIMENTAL CODE. Not to backport to core. + $parent_theme_json_data = gutenberg_add_registered_webfonts_to_theme_json( $parent_theme_json_data ); + // END OF EXPERIMENTAL CODE. + $parent_theme = new WP_Theme_JSON_Gutenberg( $parent_theme_json_data ); /* * Merge the child theme.json into the parent theme.json.