From b34e2cf374d4acb128f2e63ed70de3282b9cc6ff Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 10 Jan 2024 12:14:56 +0100 Subject: [PATCH] Allow passing inner blocks --- src/wp-includes/blocks.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 6d503837e6da2..551de65d8173d 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -787,7 +787,7 @@ function get_hooked_block_markup( $hooked_block, &$anchor_block ) { // However, its presence does not affect the frontend. $anchor_block['attrs']['metadata']['ignoredHookedBlocks'][] = $hooked_block_type; - return get_comment_delimited_block_content( $hooked_block_type, $hooked_block['attrs'], '' ); + return serialize_block( $hooked_block ); } /** @@ -824,8 +824,10 @@ function insert_hooked_blocks( &$anchor_block, $relative_position, $hooked_block $markup = ''; foreach ( $hooked_block_types as $hooked_block_type ) { $hooked_block = array( - 'blockName' => $hooked_block_type, - 'attrs' => array(), + 'blockName' => $hooked_block_type, + 'attrs' => array(), + 'innerBlocks' => array(), + 'innerContent' => array(), ); /**