wc_get_product_terms()
Wrapper used to get terms for a product.
Hooks from the function
Return
Array
.
Usage
wc_get_product_terms( $product_id, $taxonomy, $args );
- $product_id(int) (required)
- Product ID.
- $taxonomy(string) (required)
- Taxonomy slug.
- $args(array)
- Query arguments.
Default: array()
wc_get_product_terms() wc get product terms code WC 9.6.1
function wc_get_product_terms( $product_id, $taxonomy, $args = array() ) { if ( ! taxonomy_exists( $taxonomy ) ) { return array(); } return apply_filters( 'woocommerce_get_product_terms', _wc_get_cached_product_terms( $product_id, $taxonomy, $args ), $product_id, $taxonomy, $args ); }