Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer

Content_Renderer::render_without_css_inlinepublicWC 10.7.0

Render the content and collect CSS styles without inlining them.

Метод класса: Content_Renderer{}

Хуки из метода

Возвращает

Массив{html:. string, styles: string} Rendered HTML and collected CSS.

Использование

$Content_Renderer = new Content_Renderer();
$Content_Renderer->render_without_css_inline( $post, $template ): array;
$post(WP_Post) (обязательный)
Post object.
$template(WP_Block_Template) (обязательный)
Block template.

Список изменений

С версии 10.7.0 Введена.

Код Content_Renderer::render_without_css_inline() WC 10.8.1

public function render_without_css_inline( WP_Post $post, WP_Block_Template $template ): array {
	$this->set_template_globals( $post, $template );
	$this->initialize();
	try {
		do_action( 'woocommerce_email_editor_render_start' );
		$rendered_html = get_the_block_template_html();
	} finally {
		$this->reset();
	}

	return array(
		'html'   => $rendered_html,
		'styles' => $this->collect_styles( $post, $template ),
	);
}