Editor: Fix server-side attribute registration via typography support.

Ensures the `fontFamily` attribute is registered for block types on the server side. This change resolves a `400` error when attempting to change the font family for a server-side rendered block in the editor.

Props aaronrobertshaw, mamaduka, wildworks, upadalavipul.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54387


git-svn-id: http://core.svn.wordpress.org/trunk@53946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
davidbaumwald 2022-10-04 16:47:13 +00:00
parent 436bf77300
commit a8af293608
2 changed files with 7 additions and 1 deletions

View File

@ -57,6 +57,12 @@ function wp_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',
);
}
}
/**

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-beta2-54386';
$wp_version = '6.1-beta2-54387';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.