woocommerce_get_product_terms

The WooCommerce woocommerce get product terms function.

Description

woocommerce_get_product_terms( $object_id, $taxonomy, (string) $fields = 'all' ); 

Parameters (3)

0. $object_id
The object id.
1. $taxonomy
The taxonomy.
2. $fields — Optional. (string) => 'all'
The fields.

Usage

  1. if ( !function_exists( 'woocommerce_get_product_terms' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-deprecated-functions.php'; 
  3.  
  4. // The object id. 
  5. $object_id = null; 
  6.  
  7. // The taxonomy. 
  8. $taxonomy = null; 
  9.  
  10. // The fields. 
  11. $fields = 'all'; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = woocommerce_get_product_terms($object_id, $taxonomy, $fields); 
  15.  

Defined (1)

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

/includes/wc-deprecated-functions.php  
  1. function woocommerce_get_product_terms( $object_id, $taxonomy, $fields = 'all' ) { 
  2. wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_product_terms' ); 
  3. return wc_get_product_terms( $object_id, $taxonomy, array( 'fields' => $fields ) );