wpseek.com
A WordPress-centric search engine for devs and theme authors



extract_serialized_parent_block › WordPress Function

Since6.7.0
Deprecatedn/a
extract_serialized_parent_block ( $serialized_block )
Access:
  • private
Parameters:
  • (string) $serialized_block The serialized markup of a block and its inner blocks.
    Required: Yes
See:
Returns:
  • (string) The serialized markup of the wrapper block.
Defined at:
Codex:

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



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 );
}