WooCommerce Code Reference

Context_Aware_Preprocessor extends Preprocessor

Optional interface for preprocessors that need rendering context.

Table of Contents

preprocess()  : array<string|int, mixed>
Method to preprocess the content before rendering
preprocess_with_context()  : array<string|int, mixed>
Method to preprocess the content before rendering with context.

Methods

preprocess()

Method to preprocess the content before rendering

public preprocess(array<string|int, mixed> $parsed_blocks, array{contentSize: string, wideSize?: string, allowEditing?: bool, allowCustomContentAndWideSize?: bool} $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, wideSize?: string, allowEditing?: bool, allowCustomContentAndWideSize?: bool}

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>

preprocess_with_context()

Method to preprocess the content before rendering with context.

public preprocess_with_context(array<string|int, mixed> $parsed_blocks, array{contentSize: string, wideSize?: string, allowEditing?: bool, allowCustomContentAndWideSize?: bool} $layout, array{spacing: array{padding: array{bottom: string, left?: string, right?: string, top: string}, blockGap: string}} $styles[, Rendering_Context|null $rendering_context = null ]) : array<string|int, mixed>
Parameters
$parsed_blocks : array<string|int, mixed>

Parsed blocks of the email.

$layout : array{contentSize: string, wideSize?: string, allowEditing?: bool, allowCustomContentAndWideSize?: bool}

Layout of the email.

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

Styles of the email.

$rendering_context : Rendering_Context|null = null

Rendering context.

Return values
array<string|int, mixed>