Automattic\WooCommerce\EmailEditor\Engine
Theme_Controller::get_styles
Get styles for the e-mail.
Метод класса: Theme_Controller{}
Хуков нет.
Возвращает
Массив{ . spacing: array{
blockGap: string,
padding: array{bottom: string, left: string, right: string, top: string}
}, color: array{
background: string
}, typography: array{
fontFamily: string
} }
Использование
$Theme_Controller = new Theme_Controller(); $Theme_Controller->get_styles(): array;
Код Theme_Controller::get_styles() Theme Controller::get styles WC 10.5.2
public function get_styles(): array {
$theme_styles = $this->get_theme()->get_data()['styles'];
// Extract preset variables.
$theme_styles = $this->recursive_extract_preset_variables( $theme_styles );
// Replace preset values.
$variables = $this->get_variables_values_map();
$presets = array();
foreach ( $variables as $name => $value ) {
$pattern = '/var\(' . preg_quote( $name, '/' ) . '\)/i';
$presets[ $pattern ] = $value;
}
/* @phpstan-ignore-next-line Return type defined above. */
return $this->recursive_replace_presets( $theme_styles, $presets );
}