WooCommerce Code Reference

Text extends Abstract_Block_Renderer
in package

This renderer covers both core/paragraph and core/heading blocks

Table of Contents

render()  : string
Render the block.
add_spacer()  : string
Add a spacer around the block.
compile_css()  : string
Compile objects containing CSS properties to a string.
get_styles_from_block()  : array<string|int, mixed>
Wrapper for wp_style_engine_get_styles which ensures all values are returned.
render_content()  : string
Renders the block content.
adjustStyleAttribute()  : string
1) We need to remove padding because we render padding on wrapping table cell 2) We also need to replace font-size to avoid clamp() because clamp() is not supported in many email clients.

Methods

get_styles_from_block()

Wrapper for wp_style_engine_get_styles which ensures all values are returned.

protected get_styles_from_block(array<string|int, mixed> $block_styles[, bool $skip_convert_vars = false ]) : array<string|int, mixed>
Parameters
$block_styles : array<string|int, mixed>

Array of block styles.

$skip_convert_vars : bool = false

If true, --wp_preset--spacing--x type values will be left in the original var:preset:spacing:x format.

Return values
array<string|int, mixed>

adjustStyleAttribute()

1) We need to remove padding because we render padding on wrapping table cell 2) We also need to replace font-size to avoid clamp() because clamp() is not supported in many email clients.

private adjustStyleAttribute(string $block_content) : string

The font size values is automatically converted to clamp() when WP site theme is configured to use fluid layouts. Currently (WP 6.5), there is no way to disable this behavior.

Parameters
$block_content : string

Block content.

Return values
string