Automattic\WooCommerce\Blocks\Utils
StyleAttributesUtils::get_font_style_class_and_style
Get class and style for font-style from attributes.
Метод класса: StyleAttributesUtils{}
Хуков нет.
Возвращает
Массив.
Использование
$result = StyleAttributesUtils::get_font_style_class_and_style( $attributes );
- $attributes(массив) (обязательный)
- Block attributes.
Код StyleAttributesUtils::get_font_style_class_and_style() StyleAttributesUtils::get font style class and style WC 10.5.0
public static function get_font_style_class_and_style( $attributes ) {
$custom_font_style = $attributes['style']['typography']['fontStyle'] ?? '';
if ( '' !== $custom_font_style ) {
return array(
'class' => null,
'style' => sprintf( 'font-style: %s;', $custom_font_style ),
);
}
return self::EMPTY_STYLE;
}