Automattic\WooCommerce\Blocks\BlockTypes
FeaturedItem::get_styles
Get the styles for the wrapper element (background image, color).
Method of the class: FeaturedItem{}
No Hooks.
Returns
String.
Usage
$FeaturedItem = new FeaturedItem(); $FeaturedItem->get_styles( $attributes );
- $attributes(array) (required)
- Block attributes.
Default: empty array
FeaturedItem::get_styles() FeaturedItem::get styles code WC 10.3.6
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;
}