WooCommerce Code Reference

Quote_Preprocessor
in package
implements Preprocessor

Class Quote_Preprocessor

Interfaces, Classes and Traits

Preprocessor
Interface Preprocessor

Table of Contents

preprocess()  : array<string|int, mixed>
Method to preprocess the content before rendering
apply_alignment_to_children()  : array<string|int, mixed>
Apply text alignment to child blocks that don't have their own text alignment set
apply_typography_to_children()  : array<string|int, mixed>
Apply typography styles to immediate paragraph children
process_blocks()  : array<string|int, mixed>
Recursively process blocks to handle quote block alignment and typography

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>

apply_alignment_to_children()

Apply text alignment to child blocks that don't have their own text alignment set

private apply_alignment_to_children(array<string|int, mixed> $blocks[, string|null $text_align = null ]) : array<string|int, mixed>
Parameters
$blocks : array<string|int, mixed>

The blocks to process.

$text_align : string|null = null

The text alignment to apply.

Return values
array<string|int, mixed>The processed blocks.

apply_typography_to_children()

Apply typography styles to immediate paragraph children

private apply_typography_to_children(array<string|int, mixed> $blocks, array<string|int, mixed> $quote_typography, array<string|int, mixed> $styles) : array<string|int, mixed>
Parameters
$blocks : array<string|int, mixed>

The blocks to process.

$quote_typography : array<string|int, mixed>

The typography styles from the quote block.

$styles : array<string|int, mixed>

The styles from the theme.

Return values
array<string|int, mixed>The processed blocks.

process_blocks()

Recursively process blocks to handle quote block alignment and typography

private process_blocks(array<string|int, mixed> $blocks, array<string|int, mixed> $styles) : array<string|int, mixed>
Parameters
$blocks : array<string|int, mixed>

The blocks to process.

$styles : array<string|int, mixed>

The styles from the theme.

Return values
array<string|int, mixed>The processed blocks.