WooCommerce Code Reference

Initializer
in package

Initializes the core blocks renderers.

Table of Contents

ALLOWED_BLOCK_TYPES  = array('core/button', 'core/buttons', 'core/column', 'core/columns', 'core/group', 'core/heading', 'core/image', 'core/list', 'core/list-item', 'core/paragraph', 'core/quote', 'core/spacer', 'core/social-link', 'core/social-links')
List of supported blocks in the email editor.
$renderers  : array<string|int, mixed>
Cache renderers by block name.
adjust_theme_json()  : WP_Theme_JSON
Adjusts the editor's theme to add blocks specific settings for core blocks.
allow_styles()  : array<string|int, mixed>
Allow styles for the email editor.
initialize()  : void
Initializes the core blocks renderers.
render_block()  : string
Returns the block content rendered by the block renderer.
update_block_settings()  : array<string|int, mixed>
Set `supports.email = true` and configure render_email_callback for supported blocks.
get_block_renderer()  : Abstract_Block_Renderer
Return an instance of Abstract_Block_Renderer by the block name.

Constants

ALLOWED_BLOCK_TYPES

List of supported blocks in the email editor.

public mixed ALLOWED_BLOCK_TYPES = array('core/button', 'core/buttons', 'core/column', 'core/columns', 'core/group', 'core/heading', 'core/image', 'core/list', 'core/list-item', 'core/paragraph', 'core/quote', 'core/spacer', 'core/social-link', 'core/social-links')

Properties

Methods

adjust_theme_json()

Adjusts the editor's theme to add blocks specific settings for core blocks.

public adjust_theme_json(WP_Theme_JSON $editor_theme_json) : WP_Theme_JSON
Parameters
$editor_theme_json : WP_Theme_JSON

Editor theme JSON.

Return values
WP_Theme_JSON

allow_styles()

Allow styles for the email editor.

public allow_styles(array<string|int, mixed>|null $allowed_styles) : array<string|int, mixed>
Parameters
$allowed_styles : array<string|int, mixed>|null

Allowed styles.

Return values
array<string|int, mixed>

update_block_settings()

Set `supports.email = true` and configure render_email_callback for supported blocks.

public update_block_settings(array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
$settings : array<string|int, mixed>

Block settings.

Return values
array<string|int, mixed>