WooCommerce Code Reference

Blocks_Width_Preprocessor
in package
implements Preprocessor

This class sets the width of the blocks based on the layout width or column count.

The final width in pixels is stored in the email_attrs array because we would like to avoid changing the original attributes.

Interfaces, Classes and Traits

Preprocessor
Interface Preprocessor

Table of Contents

preprocess()  : array<string|int, mixed>
Method to preprocess the content before rendering
add_missing_column_widths()  : array<string|int, mixed>
Add missing column widths
convert_width_to_pixels()  : float
Convert width to pixels
parse_number_from_string_with_pixels()  : float
Parse number from string with pixels

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>