Automattic\WooCommerce\Blocks\BlockTypes

ProductCategories::get_container_classes()protectedWC 1.0

Get the list of classes to apply to this block.

Method of the class: ProductCategories{}

No Hooks.

Return

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() code WC 8.6.1

protected function get_container_classes( $attributes = array() ) {

	$classes = array( 'wc-block-product-categories' );

	if ( isset( $attributes['align'] ) ) {
		$classes[] = "align{$attributes['align']}";
	}

	if ( ! empty( $attributes['className'] ) ) {
		$classes[] = $attributes['className'];
	}

	if ( $attributes['isDropdown'] ) {
		$classes[] = 'is-dropdown';
	} else {
		$classes[] = 'is-list';
	}

	return implode( ' ', $classes );
}