Automattic\WooCommerce\Blocks\Utils
StyleAttributesUtils::get_text_decoration_class_and_style
Get class and style for text-decoration from attributes.
Method of the class: StyleAttributesUtils{}
No Hooks.
Returns
Array.
Usage
$result = StyleAttributesUtils::get_text_decoration_class_and_style( $attributes );
- $attributes(array) (required)
- Block attributes.
StyleAttributesUtils::get_text_decoration_class_and_style() StyleAttributesUtils::get text decoration class and style code WC 10.8.1
public static function get_text_decoration_class_and_style( $attributes ) {
$custom_text_decoration = $attributes['style']['typography']['textDecoration'] ?? '';
if ( '' !== $custom_text_decoration ) {
return array(
'class' => null,
'style' => sprintf( 'text-decoration: %s;', $custom_text_decoration ),
);
}
return self::EMPTY_STYLE;
}