From 4bd68be79ffcbf3fccedca77c7593fd809de534b Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:50:09 +1000 Subject: [PATCH] Add server-side fontFamily attribute registration for typography support --- lib/block-supports/typography.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/block-supports/typography.php b/lib/block-supports/typography.php index 6cfae5b8cf07e..dcfad2bbe55b4 100644 --- a/lib/block-supports/typography.php +++ b/lib/block-supports/typography.php @@ -53,6 +53,12 @@ function gutenberg_register_typography_support( $block_type ) { 'type' => 'string', ); } + + if ( $has_font_family_support && ! array_key_exists( 'fontFamily', $block_type->attributes ) ) { + $block_type->attributes['fontFamily'] = array( + 'type' => 'string', + ); + } } /**