Make WordPress Core

Changeset 54387


Ignore:
Timestamp:
10/04/2022 04:45:25 PM (2 years ago)
Author:
davidbaumwald
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/typography.php

    r54260 r54387  
    5555    if ( $has_font_size_support && ! array_key_exists( 'fontSize', $block_type->attributes ) ) {
    5656        $block_type->attributes['fontSize'] = array(
     57            'type' => 'string',
     58        );
     59    }
     60
     61    if ( $has_font_family_support && ! array_key_exists( 'fontFamily', $block_type->attributes ) ) {
     62        $block_type->attributes['fontFamily'] = array(
    5763            'type' => 'string',
    5864        );
Note: See TracChangeset for help on using the changeset viewer.