wc_get_brands()
Retrieves product's brands.
No Hooks.
Returns
Array. List of terms
Usage
wc_get_brands( $post_id, $sep, $before, $after );
- $post_id(int)
- Post ID .
Default:0) - $sep(string)
- Seperator .
Default:') - $before(string)
- Before item .
Default:'' - $after(string)
- After item .
Default:''
wc_get_brands() wc get brands code WC 10.7.0
function wc_get_brands( $post_id = 0, $sep = ', ', $before = '', $after = '' ) {
global $post;
if ( ! $post_id ) {
$post_id = $post->ID;
}
return get_the_term_list( $post_id, 'product_brand', $before, $sep, $after );
}