woocommerce_subcategory_count_html

Show the subcategory title in the product loop.

Description

apply_filters( 'woocommerce_subcategory_count_html', (string) $mark_class_count_category_count_mark, (unknown) $category ); 

Parameters (2)

0. $mark_class_count_category_count_mark — Optional. (string) => ' (' . $category->count . ')'
The mark class count category count mark.
1. $category (unknown)
The category.

Usage

To run the hook, copy the example below.
  1. $mark_class_count_category_count_mark = apply_filters( 'woocommerce_subcategory_count_html', $mark_class_count_category_count_mark, $category ); 
  2.  
  3. if ( !empty( $mark_class_count_category_count_mark ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_subcategory_count_html callback 
  2. function filter_woocommerce_subcategory_count_html( $mark_class_count_category_count_mark, $category ) { 
  3. // make filter magic happen here... 
  4. return $mark_class_count_category_count_mark
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_subcategory_count_html', 'filter_woocommerce_subcategory_count_html', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_subcategory_count_html', 'filter_woocommerce_subcategory_count_html', 10, 2 ); 

Defined (1)

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

/includes/wc-template-functions.php  
  1. echo apply_filters( 'woocommerce_subcategory_count_html', ' <mark class="count">(' . $category->count . ')</mark>', $category );