block_core_navigation_remove_serialized_parent_block

The timeline below displays how wordpress function block_core_navigation_remove_serialized_parent_block has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks.
 *
 * @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, '<!--');
    return substr($serialized_block, $start, $end - $start);
}