Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks

Quote::render_contentprotectedWC 1.0

Renders the block content.

Method of the class: Quote{}

No Hooks.

Returns

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->render_content( $block_content, $parsed_block, $settings_controller ): string;
$block_content(string) (required)
Block content.
$parsed_block(array) (required)
Parsed block.
$settings_controller(Settings_Controller) (required)
Settings controller.

Quote::render_content() code WC 9.9.5

protected function render_content( string $block_content, array $parsed_block, Settings_Controller $settings_controller ): string {
	$content    = '';
	$dom_helper = new Dom_Document_Helper( $block_content );

	// Extract citation if present.
	$citation_content = '';
	$cite_element     = $dom_helper->find_element( 'cite' );
	if ( $cite_element ) {
		$citation_content = $this->get_citation_wrapper( $dom_helper->get_element_inner_html( $cite_element ), $parsed_block );
	}

	// Process inner blocks for main content.
	$inner_blocks = $parsed_block['innerBlocks'] ?? array();
	foreach ( $inner_blocks as $block ) {
		$content .= render_block( $block );
	}

	return str_replace(
		array( '{quote_content}', '{citation_content}' ),
		array( $content, $citation_content ),
		$this->get_block_wrapper( $block_content, $parsed_block, $settings_controller )
	);
}