diff --git a/wp-includes/class-wp-block.php b/wp-includes/class-wp-block.php index 9c9a484430..10c7d92dcd 100644 --- a/wp-includes/class-wp-block.php +++ b/wp-includes/class-wp-block.php @@ -213,12 +213,16 @@ class WP_Block { } if ( $is_dynamic ) { - $global_post = $post; - $parent = WP_Block_Supports::$block_to_render; + $global_post = $post; + $parent = WP_Block_Supports::$block_to_render; + WP_Block_Supports::$block_to_render = $this->parsed_block; - $block_content = (string) call_user_func( $this->block_type->render_callback, $this->attributes, $block_content, $this ); + + $block_content = (string) call_user_func( $this->block_type->render_callback, $this->attributes, $block_content, $this ); + WP_Block_Supports::$block_to_render = $parent; - $post = $global_post; + + $post = $global_post; } if ( ! empty( $this->block_type->script ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index dfbdd3ca6c..2c8a47ebdd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-beta3-49539'; +$wp_version = '5.6-beta3-49540'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.