serialize_blocks()WP 5.3.1

Returns a joined string of the aggregate serialization of the given parsed blocks.

No Hooks.

Return

String. String of rendered HTML.

Usage

serialize_blocks( $blocks );
$blocks(array[]) (required)
An array of representative arrays of parsed block objects. See serialize_block().

Changelog

Since 5.3.1 Introduced.

serialize_blocks() code WP 6.5.2

function serialize_blocks( $blocks ) {
	return implode( '', array_map( 'serialize_block', $blocks ) );
}