Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer
Content_Renderer::render_without_css_inline
Render the content and collect CSS styles without inlining them.
Method of the class: Content_Renderer{}
Hooks from the method
Returns
Array{html:. string, styles: string} Rendered HTML and collected CSS.
Usage
$Content_Renderer = new Content_Renderer(); $Content_Renderer->render_without_css_inline( $post, $template ): array;
- $post(WP_Post) (required)
- Post object.
- $template(WP_Block_Template) (required)
- Block template.
Changelog
| Since 10.7.0 | Introduced. |
Content_Renderer::render_without_css_inline() Content Renderer::render without css inline code WC 10.7.0
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 ),
);
}