Automattic\WooCommerce\Blocks\Utils

StyleAttributesUtils::get_shadow_class_and_stylepublic staticWC 1.0

Get class and style for shadow from attributes.

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

Хуков нет.

Возвращает

Массив.

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

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

Код StyleAttributesUtils::get_shadow_class_and_style() WC 11.0.1

public static function get_shadow_class_and_style( $attributes ) {
	$shadow = $attributes['style']['shadow'] ?? null;

	if ( ! $shadow ) {
		return self::EMPTY_STYLE;
	}

	return array(
		'class' => null,
		'style' => sprintf( 'box-shadow: %s;', self::get_shadow_value( $shadow ) ),
	);
}