is_product_category

Is_product_category - Returns true when viewing a product category.

Description

is_product_category( (string) $term = '' ); 

Parameters (1)

0. $term — Optional. (string) => ''
(default: '') The term slug your checking for. Leave blank to return true on any.

Usage

  1. if ( !function_exists( 'is_product_category' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-conditional-functions.php'; 
  3.  
  4. // (default: '') The term slug your checking for. Leave blank to return true on any. 
  5. $term = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = is_product_category($term); 
  9.  

Defined (1)

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

/includes/wc-conditional-functions.php  
  1. function is_product_category( $term = '' ) { 
  2. return is_tax( 'product_cat', $term );