woocommerce_get_product_class_include_taxonomies

woocommerce_get_product_class_include_taxonomies

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_get_product_class_include_taxonomies') is found 1 times:

  • /includes/wc-template-functions.php line 709
    		$classes[] = 'has-default-attributes';
    	}
    
    	// Include attributes and any extra taxonomies only if enabled via the hook - this is a performance issue.
    	if ( apply_filters( 'woocommerce_get_product_class_include_taxonomies', false ) ) {
    		$taxonomies = get_taxonomies( array( 'public' => true ) );
    		$type       = 'variation' === $product->get_type() ? 'product_variation' : 'product';
    		foreach ( (array) $taxonomies as $taxonomy ) {
    			if ( is_object_in_taxonomy( $type, $taxonomy ) && ! in_array( $taxonomy, array( 'product_cat', 'product_tag' ), true ) ) {
    				$classes = array_merge( $classes, wc_get_product_taxonomy_class( (array) get_the_terms( $product->get_id(), $taxonomy ), $taxonomy ) );
    			}