woocommerce_get_product_terms

The WooCommerce woocommerce get product terms hook.

Description

apply_filters( 'woocommerce_get_product_terms', (unknown) $terms, (unknown) $product_id, (unknown) $taxonomy, (unknown) $args ); 

Parameters (4)

0. $terms (unknown)
The terms.
1. $product_id (unknown)
The product id.
2. $taxonomy (unknown)
The taxonomy.
3. $args (unknown)
The args.

Usage

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

Defined (1)

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

/includes/wc-term-functions.php  
  1. return apply_filters( 'woocommerce_get_product_terms' , $terms, $product_id, $taxonomy, $args );