Automattic\WooCommerce\EmailEditor\Integrations\Core

Initializer::render_blockpublicWC 1.0

Returns the block content rendered by the block renderer.

Method of the class: Initializer{}

No Hooks.

Returns

String.

Usage

$Initializer = new Initializer();
$Initializer->render_block( $block_content, $parsed_block, $rendering_context ): string;
$block_content(string) (required)
Block content.
$parsed_block(array) (required)
Parsed block settings.
$rendering_context(Rendering_Context) (required)
Rendering context.

Initializer::render_block() code WC 10.4.3

public function render_block( string $block_content, array $parsed_block, Rendering_Context $rendering_context ): string {
	if ( isset( $parsed_block['blockName'] ) ) {
		$block_renderer = $this->get_block_renderer( $parsed_block['blockName'] );
		return $block_renderer->render( $block_content, $parsed_block, $rendering_context );
	}

	return $block_content;
}