Skip to content

Commit

Permalink
Get user global styles
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed May 10, 2023
1 parent a523235 commit 0211bb9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/experimental/fonts-api/class-wp-fonts-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ class WP_Fonts_Resolver {
* @return array User selected font-families when exists, else empty array.
*/
public static function enqueue_user_selected_fonts() {
$global_styles = gutenberg_get_global_styles();
$user_selected_fonts = static::get_user_selected_fonts( $global_styles );
$user_selected_fonts = array();
$user_global_styles = WP_Theme_JSON_Resolver_Gutenberg::get_user_data()->get_raw_data();
if ( isset( $user_global_styles['styles'] ) ) {
$user_selected_fonts = static::get_user_selected_fonts( $user_global_styles['styles'] );
}

if ( empty( $user_selected_fonts ) ) {
return array();
}
Expand Down

0 comments on commit 0211bb9

Please sign in to comment.