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

Typography_Preprocessor::copy_typography_from_parentprivateWC 1.0

Copy typography styles from parent to children

Метод класса: Typography_Preprocessor{}

Хуков нет.

Возвращает

Массив.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->copy_typography_from_parent( $children, $parent_block ): array;
$children(массив) (обязательный)
List of children blocks.
$parent_block(массив) (обязательный)
Parent block.

Код Typography_Preprocessor::copy_typography_from_parent() WC 10.9.4

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;
}