Automattic\WooCommerce\Blocks\Utils

StyleAttributesUtils::get_styles_by_attributes()public staticWC 1.0

Get space-separated style rules from block attributes.

Method of the class: StyleAttributesUtils{}

No Hooks.

Return

String. Space-separated style rules.

Usage

$result = StyleAttributesUtils::get_styles_by_attributes( $attributes, $properties );
$attributes(array) (required)
Block attributes.
$properties(array)
Properties to get styles from.
Default: array()

StyleAttributesUtils::get_styles_by_attributes() code WC 9.4.2

public static function get_styles_by_attributes( $attributes, $properties = array() ) {
	$classes_and_styles = self::get_classes_and_styles_by_attributes( $attributes, $properties );

	return $classes_and_styles['styles'];
}