wc_product_cat_class

Display the classes for the product cat div.

Description

wc_product_cat_class( (string) $class = '', (null) $category = null ); 

Parameters (2)

0. $class — Optional. (string) => ''
One or more classes to add to the class list.
1. $category — Optional. (null) => null
Object Optional.

Usage

  1. if ( !function_exists( 'wc_product_cat_class' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php'; 
  3.  
  4. // One or more classes to add to the class list. 
  5. $class = ''; 
  6.  
  7. // object Optional. 
  8. $category = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_product_cat_class($class, $category); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-template-functions.php  
  1. function wc_product_cat_class( $class = '', $category = null ) { 
  2. // Separates classes with a single space, collates classes for post DIV 
  3. echo 'class="' . esc_attr( join( ' ', wc_get_product_cat_class( $class, $category ) ) ) . '"';