Automattic\WooCommerce\EmailEditor\Engine
Site_Style_Sync_Controller::convert_element_style
Convert individual element style to email format
Метод класса: Site_Style_Sync_Controller{}
Хуков нет.
Возвращает
array. Email-compatible element style.
Использование
// private - только в коде основоного (родительского) класса $result = $this->convert_element_style( $element_style, $element_name ): array;
- $element_style(массив) (обязательный)
- Site element style.
- $element_name(строка)
- Element name (e.g.,
'h1','h2', 'button').
По умолчанию:''
Код Site_Style_Sync_Controller::convert_element_style() Site Style Sync Controller::convert element style WC 11.2.2
private function convert_element_style( array $element_style, string $element_name = '' ): array {
$email_element = array();
// Convert typography if present.
if ( isset( $element_style['typography'] ) ) {
$email_element['typography'] = $this->convert_typography_styles( $element_style['typography'], $element_name );
}
// Convert color if present.
if ( isset( $element_style['color'] ) ) {
$email_element['color'] = $this->convert_color_styles( $element_style['color'] );
}
// Convert spacing if present.
if ( isset( $element_style['spacing'] ) ) {
$email_element['spacing'] = $this->convert_spacing_styles( $element_style['spacing'] );
}
return $email_element;
}