wc_get_product_terms( int $product_id, string $taxonomy, array $args = array() )

Wrapper used to get terms for a product.


Description Description


Parameters Parameters

$product_id

(Required) Product ID.

$taxonomy

(Required) Taxonomy slug.

$args

(Optional) Query arguments.

Default value: array()


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/wc-term-functions.php

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 );
}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.