From e01c6798b43ce13b1684b3f4952934b8069e781d Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Tue, 18 May 2021 22:00:28 +0200 Subject: [PATCH] Add server-side handling --- lib/block-supports/typography.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/block-supports/typography.php b/lib/block-supports/typography.php index 52555eb3169b23..69771d0c06ee1f 100644 --- a/lib/block-supports/typography.php +++ b/lib/block-supports/typography.php @@ -91,7 +91,7 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) { if ( $has_font_family_support ) { $font_family = $block_attributes['style']['typography']['fontFamily']; // Apply required class and style. - if ( isset( $font_family ) ) { + if ( isset( $font_family ) ) { // Legacy case. if ( strpos( $font_family, 'var:preset|font-family' ) !== false ) { // Get the name from the string and add proper styles. $index_to_splice = strrpos( $font_family, '|' ) + 1; @@ -100,6 +100,8 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) { } else { $styles[] = sprintf( 'font-family: %s;', $font_family ); } + } elseif ( isset( $block_attributes['fontFamily'] ) ) { // Current attribute style. + $styles[] = sprintf( 'font-family: %s;', $block_attributes['fontFamily'] ); } }