wc_product_post_type_link_product_cat

The WooCommerce wc product post type link cat hook.

Description

apply_filters( 'wc_product_post_type_link_product_cat', (unknown) $terms_0, (unknown) $terms, (unknown) $post ); 

Parameters (3)

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

Usage

To run the hook, copy the example below.
  1. $terms_0 = apply_filters( 'wc_product_post_type_link_product_cat', $terms_0, $terms, $post ); 
  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 wc_product_post_type_link_product_cat callback 
  2. function filter_wc_product_post_type_link_product_cat( $terms_0, $terms, $post ) { 
  3. // make filter magic happen here... 
  4. return $terms_0
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wc_product_post_type_link_product_cat', 'filter_wc_product_post_type_link_product_cat', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wc_product_post_type_link_product_cat', 'filter_wc_product_post_type_link_product_cat', 10, 3 ); 

Defined (1)

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

/includes/wc-product-functions.php  
  1. $category_object = apply_filters( 'wc_product_post_type_link_product_cat', $terms[0], $terms, $post );