Automattic\WooCommerce\Blocks\BlockTypes

FeaturedItem::get_styles │ public │ WC 1.0

Get Featured-specific height styles for the block wrapper.

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

Хуков нет.

Возвращает

string.

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

$FeaturedItem = new FeaturedItem();
$FeaturedItem->get_styles( $attributes );
$attributes(массив) (обязательный)
Block attributes.
По умолчанию: empty array

Код FeaturedItem::get_styles() WC 11.3.0

public function get_styles( $attributes ) {
	$style = sprintf( '--wc-featured-item-min-height:%dpx;', wc_get_theme_support( 'featured_block::default_height', 500 ) );

	if ( isset( $attributes['minHeight'] ) && ! isset( $attributes['style']['dimensions']['minHeight'] ) ) {
		$style .= sprintf( 'min-height:%dpx;', intval( $attributes['minHeight'] ) );
	}

	return $style;
}