Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks
Quote::render_content
Renders the block content
Метод класса: Quote{}
Хуков нет.
Возвращает
Строку.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->render_content( $block_content, $parsed_block, $rendering_context ): string;
- $block_content(строка) (обязательный)
- Block content.
- $parsed_block(массив) (обязательный)
- Parsed block.
- $rendering_context(Rendering_Context) (обязательный)
- Rendering context.
Код Quote::render_content() Quote::render content WC 10.4.3
protected function render_content( string $block_content, array $parsed_block, Rendering_Context $rendering_context ): string {
$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,
$rendering_context
);
}
return str_replace(
array( '{quote_content}', '{citation_content}' ),
array( $this->get_inner_content( $block_content ), $citation_content ),
$this->get_block_wrapper( $block_content, $parsed_block, $rendering_context )
);
}