From 47c55ccb589a70f4550a82d7683272d7155ad982 Mon Sep 17 00:00:00 2001 From: Andrei Draganescu Date: Wed, 7 Dec 2022 18:06:05 +0000 Subject: [PATCH] handle innerContent too when removing innerBlocks --- packages/block-library/src/navigation/index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index e497646e1c5bb..08a09f9184b51 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -423,6 +423,9 @@ function( $carry, $block ) use ( $allowed_blocks ) { if ( isset( $block['blockName'] ) && in_array( $block['blockName'], $allowed_blocks, true ) ) { if ( $block['innerBlocks'] ) { $block['innerBlocks'] = block_core_navigation_filter_out_invalid_blocks( $block['innerBlocks'] ); + if ( empty( $block['innerBlocks'] ) ) { + $block['innerContent'] = array( implode( $block['innerContent'] ) ); + } } $carry[] = $block; }