Skip to content

Commit 6a37f03

Browse files
committed
Recalculate inner block context after filter
1 parent 898ab5a commit 6a37f03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wp-includes/class-wp-block.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,9 @@ public function render( $options = array() ) {
496496
/** This filter is documented in wp-includes/blocks.php */
497497
$inner_block->context = apply_filters( 'render_block_context', $inner_block->context, $inner_block->parsed_block, $parent_block );
498498

499-
$block_content .= $inner_block->render();
499+
$this->inner_blocks[ $index ] = new WP_Block( $inner_block->parsed_block, $inner_block->context, $this->registry );
500+
501+
$block_content .= $this->inner_blocks[ $index ]->render();
500502
}
501503

502504
++$index;

0 commit comments

Comments
 (0)