Automattic\WooCommerce\Blocks\Templates

SingleProductTemplateCompatibility::serialize_blocks()private staticWC 1.0

Serialize template.

Method of the class: SingleProductTemplateCompatibility{}

No Hooks.

Return

String.

Usage

$result = SingleProductTemplateCompatibility::serialize_blocks( $parsed_blocks );
$parsed_blocks(array) (required)
Parsed blocks.

SingleProductTemplateCompatibility::serialize_blocks() code WC 8.9.0

private static function serialize_blocks( $parsed_blocks ) {
	return array_reduce(
		$parsed_blocks,
		function ( $carry, $item ) {
			if ( is_array( $item ) ) {
				return $carry . serialize_blocks( $item );
			}
			return $carry . serialize_block( $item );
		},
		''
	);
}