Automattic\WooCommerce\EmailEditor\Engine
Theme_Controller::translate_slug_to_color
Translate a color slug to the color the palette gives it.
A slug can be missing from the palette because the post was written under a different theme, or came from a palette the email does not carry. Styles_Helper::resolve_color_from_palette().
Метод класса: Theme_Controller{}
Хуков нет.
Возвращает
string. The color value, or an empty string for a slug the palette does not define.
Использование
$Theme_Controller = new Theme_Controller(); $Theme_Controller->translate_slug_to_color( $color_slug ): string;
- $color_slug(строка) (обязательный)
- Color slug, or a literal color.
Код Theme_Controller::translate_slug_to_color() Theme Controller::translate slug to color WC 11.3.0
public function translate_slug_to_color( string $color_slug ): string {
return Styles_Helper::resolve_color_from_palette( $this->get_settings(), $color_slug );
}