diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 1745ba61bf25a1..73b682fd6a4311 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -1369,25 +1369,28 @@ function block_core_navigation_get_most_recently_published_navigation() { } /** - * Insert hooked blocks into a Navigation block. - * - * Given a Navigation block's inner blocks and its corresponding `wp_navigation` post object, - * this function inserts hooked blocks into it, and returns the serialized inner blocks in a - * mock Navigation block wrapper. + * Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks. * - * If there are any hooked blocks that need to be inserted as the Navigation block's first or last - * children, the `wp_navigation` post's `_wp_ignored_hooked_blocks` meta is checked to see if any - * of those hooked blocks should be exempted from insertion. + * @param string $serialized_block The serialized markup of a block and its inner blocks. + * @return string + */ +function block_core_navigation_remove_serialized_parent_block( $serialized_block ) { + $start = strpos( $serialized_block, '-->' ) + strlen( '-->' ); + $end = strrpos( $serialized_block, '' ) + strlen( '-->' ); - $end = strrpos( $serialized_block, '