Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer\Preprocessors
Typography_Preprocessor::copy_typography_from_parent
Copy typography styles from parent to children
Method of the class: Typography_Preprocessor{}
No Hooks.
Returns
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() Typography Preprocessor::copy typography from parent code WC 10.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;
}