From cd183cccf8b7b56bc10d55a161df93d6c86b898e Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Tue, 23 Jan 2024 15:02:06 +0800 Subject: [PATCH] Remove the experiment flag after reverting pattern block index.php changes --- packages/block-library/src/block/index.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/block-library/src/block/index.php b/packages/block-library/src/block/index.php index 54b54fad139ff3..fb80c64f1e3405 100644 --- a/packages/block-library/src/block/index.php +++ b/packages/block-library/src/block/index.php @@ -46,17 +46,14 @@ function render_block_core_block( $attributes ) { $content = $wp_embed->run_shortcode( $reusable_block->post_content ); $content = $wp_embed->autoembed( $content ); - $gutenberg_experiments = get_option( 'gutenberg-experiments' ); - $has_partial_synced_overrides = $gutenberg_experiments - && array_key_exists( 'gutenberg-pattern-partial-syncing', $gutenberg_experiments ) - && isset( $attributes['overrides'] ); + $has_pattern_overrides = isset( $attributes['overrides'] ); /** * We set the `pattern/overrides` context through the `render_block_context` * filter so that it is available when a pattern's inner blocks are * rendering via do_blocks given it only receives the inner content. */ - if ( $has_partial_synced_overrides ) { + if ( $has_pattern_overrides ) { $filter_block_context = static function ( $context ) use ( $attributes ) { $context['pattern/overrides'] = $attributes['overrides']; return $context; @@ -67,7 +64,7 @@ function render_block_core_block( $attributes ) { $content = do_blocks( $content ); unset( $seen_refs[ $attributes['ref'] ] ); - if ( $has_partial_synced_overrides ) { + if ( $has_pattern_overrides ) { remove_filter( 'render_block_context', $filter_block_context, 1 ); }