Make WordPress Core


Ignore:
Timestamp:
02/09/2024 06:20:12 PM (10 months ago)
Author:
youknowriad
Message:

Editor: Update the WordPress packages to Gutenberg 17.7RC1.

This brings the latest and greatest from Gutenberg.
The full changelog is available here
https://github.com/WordPress/gutenberg/releases/tag/v17.7.0-rc.1

Props youknowriad, get_dave.
See #60315.

File:
1 edited

Legend:

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

    r57377 r57578  
    4747    $content = $wp_embed->autoembed( $content );
    4848
    49     $has_pattern_overrides = isset( $attributes['overrides'] );
     49    // Back compat, the content attribute was previously named overrides and
     50    // had a slightly different format. For blocks that have not been migrated,
     51    // also convert the format here so that the provided `pattern/overrides`
     52    // context is correct.
     53    if ( isset( $attributes['overrides'] ) && ! isset( $attributes['content'] ) ) {
     54        $migrated_content = array();
     55        foreach ( $attributes['overrides'] as $id => $values ) {
     56            $migrated_content[ $id ] = array(
     57                'values' => $values,
     58            );
     59        }
     60        $attributes['content'] = $migrated_content;
     61    }
     62    $has_pattern_overrides = isset( $attributes['content'] );
    5063
    5164    /**
     
    5669    if ( $has_pattern_overrides ) {
    5770        $filter_block_context = static function ( $context ) use ( $attributes ) {
    58             $context['pattern/overrides'] = $attributes['overrides'];
     71            $context['pattern/overrides'] = $attributes['content'];
    5972            return $context;
    6073        };
Note: See TracChangeset for help on using the changeset viewer.