Make WordPress Core


Ignore:
Timestamp:
01/29/2024 09:04:18 PM (7 months ago)
Author:
youknowriad
Message:

Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.

This patch, somewhat small brings a lot to WordPress.
This includes features like:

  • DataViews.
  • Customization tools like box shadow, background size and repeat.
  • UI improvements in the site editor.
  • Preferences sharing between the post and site editors.
  • Unified panels and editors between post and site editors.
  • Improved template mode in the post editor.
  • Iterations to multiple interactive blocks.
  • Preparing the blocks and UI for pattern overrides.
  • and a lot more.

Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.

File:
1 edited

Legend:

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

    r55246 r57377  
    4747    $content = $wp_embed->autoembed( $content );
    4848
     49    $has_pattern_overrides = isset( $attributes['overrides'] );
     50
     51    /**
     52     * We set the `pattern/overrides` context through the `render_block_context`
     53     * filter so that it is available when a pattern's inner blocks are
     54     * rendering via do_blocks given it only receives the inner content.
     55     */
     56    if ( $has_pattern_overrides ) {
     57        $filter_block_context = static function ( $context ) use ( $attributes ) {
     58            $context['pattern/overrides'] = $attributes['overrides'];
     59            return $context;
     60        };
     61        add_filter( 'render_block_context', $filter_block_context, 1 );
     62    }
     63
    4964    $content = do_blocks( $content );
    5065    unset( $seen_refs[ $attributes['ref'] ] );
     66
     67    if ( $has_pattern_overrides ) {
     68        remove_filter( 'render_block_context', $filter_block_context, 1 );
     69    }
     70
    5171    return $content;
    5272}
Note: See TracChangeset for help on using the changeset viewer.