MailPoet\EmailEditor\Engine\Renderer\ContentRenderer\Preprocessors

Typography_Preprocessor::preprocess()publicWC 1.0

Method to preprocess the content before rendering

Method of the class: Typography_Preprocessor{}

No Hooks.

Return

Array.

Usage

$Typography_Preprocessor = new Typography_Preprocessor();
$Typography_Preprocessor->preprocess( $parsed_blocks, $layout, $styles ): array;
$parsed_blocks(array) (required)
Parsed blocks of the email.
$layout(array) (required)
-
$styles(array) (required)
-

Typography_Preprocessor::preprocess() code WC 9.8.1

public function preprocess( array $parsed_blocks, array $layout, array $styles ): array {
	foreach ( $parsed_blocks as $key => $block ) {
		$block = $this->preprocess_parent( $block );
		// Set defaults from theme - this needs to be done on top level blocks only.
		$block = $this->set_defaults_from_theme( $block );

		$block['innerBlocks']  = $this->copy_typography_from_parent( $block['innerBlocks'], $block );
		$parsed_blocks[ $key ] = $block;
	}
	return $parsed_blocks;
}