From b36efef0e93473b071e0b58e43b880804a79df29 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Thu, 3 Aug 2023 11:12:14 +0200 Subject: [PATCH] Undo calling gutenberg_parse_and_serialize_blocks --- lib/experimental/auto-inserting-blocks.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/experimental/auto-inserting-blocks.php b/lib/experimental/auto-inserting-blocks.php index aa8b33fe1e9ef..90f3bdf15e509 100644 --- a/lib/experimental/auto-inserting-blocks.php +++ b/lib/experimental/auto-inserting-blocks.php @@ -164,7 +164,8 @@ function gutenberg_parse_and_serialize_block_templates( $query_result ) { if ( 'custom' === $block_template->source ) { continue; } - gutenberg_parse_and_serialize_blocks( $block_template ); + $blocks = parse_blocks( $block_template->content ); + $block_template->content = gutenberg_serialize_blocks( $blocks ); } return $query_result; @@ -182,7 +183,7 @@ function gutenberg_parse_and_serialize_block_templates( $query_result ) { * * @param WP_Block_Template|null $block_template The found block template, or null if there is none. */ -function gutenberg_parse_and_serialize_blocks( &$block_template ) { +function gutenberg_parse_and_serialize_blocks( $block_template ) { $blocks = parse_blocks( $block_template->content ); $block_template->content = gutenberg_serialize_blocks( $blocks );