WooCommerce Code Reference

Typography_Preprocessor
in package
implements Preprocessor

This preprocessor is responsible for setting default typography values for blocks.

Interfaces, Classes and Traits

Preprocessor
Interface Preprocessor

Table of Contents

TYPOGRAPHY_STYLES  = array('color', 'font-size', 'text-decoration')
List of styles that should be copied from parent to children.
$settings_controller  : Settings_Controller
Injected settings controller
__construct()  : mixed
Typography_Preprocessor constructor.
preprocess()  : array<string|int, mixed>
Method to preprocess the content before rendering
copy_typography_from_parent()  : array<string|int, mixed>
Copy typography styles from parent to children
filterStyles()  : array<string|int, mixed>
Filter styles to only include typography styles
preprocess_parent()  : array<string|int, mixed>
Preprocess parent block
set_defaults_from_theme()  : array<string|int, mixed>
Set default values from theme

Constants

Properties

Methods

preprocess()

Method to preprocess the content before rendering

public preprocess(array<string|int, mixed> $parsed_blocks, array{contentSize: string} $layout, array{spacing: array{padding: array{bottom: string, left: string, right: string, top: string}, blockGap: string}} $styles) : array<string|int, mixed>
Parameters
$parsed_blocks : array<string|int, mixed>

Parsed blocks of the email.

$layout : array{contentSize: string}

Layout of the email.

$styles : array{spacing: array{padding: array{bottom: string, left: string, right: string, top: string}, blockGap: string}}

Styles of the email.

Return values
array<string|int, mixed>

copy_typography_from_parent()

Copy typography styles from parent to children

private copy_typography_from_parent(array<string|int, mixed> $children, array<string|int, mixed> $parent_block) : array<string|int, mixed>
Parameters
$children : array<string|int, mixed>

List of children blocks.

$parent_block : array<string|int, mixed>

Parent block.

Return values
array<string|int, mixed>