Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer
Content_Renderer::render
Render the content with inlined CSS styles.
Method of the class: Content_Renderer{}
No Hooks.
Returns
String. Rendered HTML content with inlined styles.
Usage
$Content_Renderer = new Content_Renderer(); $Content_Renderer->render( $post, $template ): string;
- $post(WP_Post) (required)
- Post object.
- $template(WP_Block_Template) (required)
- Block template.
Content_Renderer::render() Content Renderer::render code WC 10.7.0
public function render( WP_Post $post, WP_Block_Template $template ): string {
$result = $this->render_without_css_inline( $post, $template );
$styles = '<style>' . $result['styles'] . '</style>';
$html = $this->css_inliner->from_html( $styles . $result['html'] )->inline_css()->render();
return $this->process_manager->postprocess( $html );
}