Automattic\WooCommerce\Blocks\Utils

StyleAttributesUtils::get_line_height_class_and_style()public staticWC 1.0

Get class and style for line height from attributes.

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

Хуков нет.

Возвращает

Массив.

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

$result = StyleAttributesUtils::get_line_height_class_and_style( $attributes );
$attributes(массив) (обязательный)
Block attributes.

Код StyleAttributesUtils::get_line_height_class_and_style() WC 8.7.0

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 ),
	);
}