MailPoet\EmailEditor\Engine\Renderer\ContentRenderer\Preprocessors

Typography_Preprocessor::copy_typography_from_parent()privateWC 1.0

Copy typography styles from parent to children

Method of the class: Typography_Preprocessor{}

No Hooks.

Return

Array.

Usage

// private - for code of main (parent) class only
$result = $this->copy_typography_from_parent( $children, $parent_block ): array;
$children(array) (required)
List of children blocks.
$parent_block(array) (required)
Parent block.

Typography_Preprocessor::copy_typography_from_parent() code WC 9.8.1

private function copy_typography_from_parent( array $children, array $parent_block ): array {
	foreach ( $children as $key => $child ) {
		$child                = $this->preprocess_parent( $child );
		$child['email_attrs'] = array_merge( $this->filterStyles( $parent_block['email_attrs'] ), $child['email_attrs'] );
		$child['innerBlocks'] = $this->copy_typography_from_parent( $child['innerBlocks'] ?? array(), $child );
		$children[ $key ]     = $child;
	}

	return $children;
}