Skip to content

Commit

Permalink
experimental: port webfonts (experimental API)
Browse files Browse the repository at this point in the history
see #37140
  • Loading branch information
oandregal committed Dec 22, 2022
1 parent 31e4b00 commit 26bf599
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/class-wp-theme-json-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 26bf599

Please sign in to comment.