Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the wrapper block.
Description
See also
Parameters
$serialized_block
stringrequired- The serialized markup of a block and its inner blocks.
Source
function extract_serialized_parent_block( $serialized_block ) {
$start = strpos( $serialized_block, '-->' ) + strlen( '-->' );
$end = strrpos( $serialized_block, '<!--' );
return substr( $serialized_block, 0, $start ) . substr( $serialized_block, $end );
}
Changelog
Version | Description |
---|---|
6.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.