Changeset 57377 for trunk/src/wp-includes/blocks/block.php
- Timestamp:
- 01/29/2024 09:04:18 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/block.php
r55246 r57377 47 47 $content = $wp_embed->autoembed( $content ); 48 48 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 49 64 $content = do_blocks( $content ); 50 65 unset( $seen_refs[ $attributes['ref'] ] ); 66 67 if ( $has_pattern_overrides ) { 68 remove_filter( 'render_block_context', $filter_block_context, 1 ); 69 } 70 51 71 return $content; 52 72 }
Note: See TracChangeset
for help on using the changeset viewer.