WooCommerce Code Reference

Content_Renderer
in package

Class Content_Renderer

Table of Contents

CONTENT_STYLES_FILE  = 'content.css'
$blocks_registry  : Blocks_Registry
Blocks registry
$css_inliner  : Css_Inliner
CSS inliner
$process_manager  : Process_Manager
Process manager
$settings_controller  : Settings_Controller
Settings controller
$theme_controller  : Theme_Controller
Theme controller
__construct()  : mixed
Content_Renderer constructor.
block_parser()  : string
Get block parser class
preprocess_parsed_blocks()  : array<string|int, mixed>
Preprocess parsed blocks
render()  : string
Render the content
render_block()  : string
Renders block Translates block's HTML to HTML suitable for email clients. The method is intended as a callback for 'render_block' filter.
initialize()  : void
Initialize the content renderer
inline_styles()  : string
Method to inline styles into the HTML
reset()  : void
As we use default WordPress filters, we need to remove them after email rendering so that we don't interfere with possible post rendering that might happen later.
set_template_globals()  : void
Set template globals

Constants

Properties

Methods

__construct()

Content_Renderer constructor.

public __construct(Process_Manager $preprocess_manager, Blocks_Registry $blocks_registry, Settings_Controller $settings_controller, Css_Inliner $css_inliner, Theme_Controller $theme_controller) : mixed
Parameters
$preprocess_manager : Process_Manager

Preprocess manager.

$blocks_registry : Blocks_Registry

Blocks registry.

$settings_controller : Settings_Controller

Settings controller.

$css_inliner : Css_Inliner

Css inliner.

$theme_controller : Theme_Controller

Theme controller.

Return values
mixed

render_block()

Renders block Translates block's HTML to HTML suitable for email clients. The method is intended as a callback for 'render_block' filter.

public render_block(string $block_content, array<string|int, mixed> $parsed_block) : string
Parameters
$block_content : string

Block content.

$parsed_block : array<string|int, mixed>

Parsed block.

Return values
string