wc_get_product_category_list( int $product_id, string $sep = ', ', string $before = '', string $after = '' )

Returns the product categories in a list.


Description Description


Parameters Parameters

$product_id

(Required) Product ID.

$sep

(Optional) (default: ', ').

Default value: ', '

$before

(Optional) (default: '').

Default value: ''

$after

(Optional) (default: '').

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/wc-product-functions.php

function wc_get_product_category_list( $product_id, $sep = ', ', $before = '', $after = '' ) {
	return get_the_term_list( $product_id, 'product_cat', $before, $sep, $after );
}


Top ↑

User Contributed Notes User Contributed Notes

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