woocommerce_breadcrumb_main_term

The WooCommerce woocommerce breadcrumb main term hook.

Description

apply_filters( 'woocommerce_breadcrumb_main_term', (unknown) $terms_0, (unknown) $terms ); 

Parameters (2)

0. $terms_0 (unknown)
The terms 0.
1. $terms (unknown)
The terms.

Usage

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

Defined (1)

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

/includes/class-wc-breadcrumb.php  
  1. $main_term = apply_filters( 'woocommerce_breadcrumb_main_term', $terms[0], $terms );