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