remove_serialized_parent_block( string $serialized_block ): string

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks.

Parameters

$serialized_blockstringrequired
The serialized markup of a block and its inner blocks.

Return

string The serialized markup of the inner blocks.

Source

function remove_serialized_parent_block( $serialized_block ) {
	$start = strpos( $serialized_block, '-->' ) + strlen( '-->' );
	$end   = strrpos( $serialized_block, '<!--' );
	return substr( $serialized_block, $start, $end - $start );
}

Changelog

VersionDescription
6.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.