Skip to content

Commit

Permalink
Register all fonts before enqueing any (#40489)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbking authored Apr 22, 2022
1 parent 58541a9 commit a0e1728
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/experimental/register-webfonts-from-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ function gutenberg_register_webfonts_from_theme_json() {
}
foreach ( $webfonts as $webfont ) {
wp_webfonts()->register_webfont( $webfont );
}
foreach ( $webfonts as $webfont ) {
wp_webfonts()->enqueue_webfont( $webfont['font-family'] );
}
}
Expand Down

0 comments on commit a0e1728

Please sign in to comment.