Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer

Rendering_Context::translate_slug_to_color │ public │ WC 1.0

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().

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

Хуков нет.

Возвращает

string. The color value, or an empty string for a slug the palette does not define.

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

$Rendering_Context = new Rendering_Context();
$Rendering_Context->translate_slug_to_color( $color_slug ): string;
$color_slug(строка) (обязательный)
Color slug, or a literal color.

Код Rendering_Context::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_theme_settings(), $color_slug );
}