Make WordPress Core


Ignore:
Timestamp:
06/08/2021 08:07:15 AM (4 years ago)
Author:
youknowriad
Message:

Block Editor: Package updates for 5.8 beta 1.

This includes the following fixes:

Widgets Editor:

Widget blocks in the customizer:

Global Styles:

Template Editor:

Miscellaneous:

Performance:

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r51046 r51089  
    957957}
    958958
     959function wp_migrate_old_typography_shape( $metadata ) {
     960    $typography_keys = array(
     961        '__experimentalFontFamily',
     962        '__experimentalFontStyle',
     963        '__experimentalFontWeight',
     964        '__experimentalLetterSpacing',
     965        '__experimentalTextDecoration',
     966        '__experimentalTextTransform',
     967        'fontSize',
     968        'lineHeight',
     969    );
     970    foreach ( $typography_keys as $typography_key ) {
     971        $support_for_key = _wp_array_get( $metadata['supports'], array( $typography_key ), null );
     972        if ( null !== $support_for_key ) {
     973            trigger_error(
     974                /* translators: %1$s: Block type, %2$s: typography supports key e.g: fontSize, lineHeight etc... */
     975                sprintf( __( 'Block %1$s is declaring %2$s support on block.json under supports.%2$s. %2$s support is now declared under supports.typography.%2$s.', 'gutenberg' ), $metadata['name'], $typography_key ),
     976                headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
     977            );
     978            gutenberg_experimental_set( $metadata['supports'], array( 'typography', $typography_key ), $support_for_key );
     979            unset( $metadata['supports'][ $typography_key ] );
     980        }
     981    }
     982    return $metadata;
     983}
     984
    959985/**
    960986 * Helper function that constructs a WP_Query args array from
Note: See TracChangeset for help on using the changeset viewer.