Automattic\WooCommerce\Blocks\BlockTypes
ProductCategories::get_container_classes
Get the list of classes to apply to this block.
Method of the class: ProductCategories{}
No Hooks.
Returns
String. space-separated list of classes.
Usage
// protected - for code of main (parent) or child class $result = $this->get_container_classes( $attributes );
- $attributes(array)
- Block attributes.
Default: empty array
ProductCategories::get_container_classes() ProductCategories::get container classes code WC 10.3.3
protected function get_container_classes( $attributes = array() ) {
$classes = array( 'wc-block-product-categories' );
if ( isset( $attributes['align'] ) ) {
$classes[] = "align{$attributes['align']}";
}
if ( $attributes['isDropdown'] ) {
$classes[] = 'is-dropdown';
} else {
$classes[] = 'is-list';
}
return implode( ' ', $classes );
}