Skip to content

Commit

Permalink
Webfonts: Fix webfont loading in the Site Editor (#40262)
Browse files Browse the repository at this point in the history
* Webfonts: Fix webfont loading in the Site Editor

* fix linter
  • Loading branch information
scruffian authored Apr 18, 2022
1 parent 873aa27 commit b86f98f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/experimental/register-webfonts-from-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ function gutenberg_register_webfonts_from_theme_json() {
}

// Merge the variation settings with the global settings.
$settings['typography'] = empty( $settings['typography'] ) ? array() : $settings['typography'];
$settings['typography']['fontFamilies'] = empty( $settings['typography']['fontFamilies'] ) ? array() : $settings['typography']['fontFamilies'];
$settings['typography']['fontFamilies'] = array_merge( $settings['typography']['fontFamilies'], $variation['settings']['typography']['fontFamilies'] );
$settings['typography'] = empty( $settings['typography'] ) ? array() : $settings['typography'];
$settings['typography']['fontFamilies'] = empty( $settings['typography']['fontFamilies'] ) ? array() : $settings['typography']['fontFamilies'];
$settings['typography']['fontFamilies']['theme'] = empty( $settings['typography']['fontFamilies'] ) ? array() : $settings['typography']['fontFamilies']['theme'];
$settings['typography']['fontFamilies']['theme'] = array_merge( $settings['typography']['fontFamilies']['theme'], $variation['settings']['typography']['fontFamilies']['theme'] );

// Make sure there are no duplicates.
$settings['typography']['fontFamilies'] = array_unique( $settings['typography']['fontFamilies'] );
Expand Down

0 comments on commit b86f98f

Please sign in to comment.