Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer\Preprocessors

Context_Aware_Preprocessor{}interfaceWC 1.0└─ Preprocessor

Optional interface for preprocessors that need rendering context.

No Hooks.

Usage

$Context_Aware_Preprocessor = new Context_Aware_Preprocessor();
// use class methods

Methods

  1. public preprocess_with_context( array $parsed_blocks, array $layout, array $styles, ?Rendering_Context $rendering_context = null )

Context_Aware_Preprocessor{} code WC 10.9.4

interface Context_Aware_Preprocessor extends Preprocessor {
	/**
	 * Method to preprocess the content before rendering with context.
	 *
	 * @param array                                                                                                               $parsed_blocks Parsed blocks of the email.
	 * @param array{contentSize: string, wideSize?: string, allowEditing?: bool, allowCustomContentAndWideSize?: bool}            $layout Layout of the email.
	 * @param array{spacing: array{padding: array{bottom: string, left?: string, right?: string, top: string}, blockGap: string}} $styles Styles of the email.
	 * @param Rendering_Context|null                                                                                              $rendering_context Rendering context.
	 * @return array
	 */
	public function preprocess_with_context( array $parsed_blocks, array $layout, array $styles, ?Rendering_Context $rendering_context = null ): array;
}