Automattic\WooCommerce\Blocks\BlockTypes
FeaturedItem::get_styles
Get Featured-specific height styles for the block wrapper.
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 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;
}