Automattic\WooCommerce\Blocks\BlockTypes
FeaturedItem::get_styles()
Get the styles for the wrapper element (background image, color).
Метод класса: FeaturedItem{}
Хуков нет.
Возвращает
Строку
.
Использование
$FeaturedItem = new FeaturedItem(); $FeaturedItem->get_styles( $attributes );
- $attributes(массив) (обязательный)
- Block attributes.
По умолчанию: empty array
Код FeaturedItem::get_styles() FeaturedItem::get styles WC 7.7.0
public function get_styles( $attributes ) { $style = ''; $min_height = $attributes['minHeight'] ?? wc_get_theme_support( 'featured_block::default_height', 500 ); if ( isset( $attributes['minHeight'] ) ) { $style .= sprintf( 'min-height:%dpx;', intval( $min_height ) ); } $global_style_style = StyleAttributesUtils::get_styles_by_attributes( $attributes, $this->global_style_wrapper ); $style .= $global_style_style; return $style; }