WC_Brands_Coupons::get_product_brands
Get a list of brands that are assigned to a specific product
Method of the class: WC_Brands_Coupons{}
No Hooks.
Returns
Array. brands
Usage
// private - for code of main (parent) class only $result = $this->get_product_brands( $product_id );
- $product_id(int) (required)
- Product id.
WC_Brands_Coupons::get_product_brands() WC Brands Coupons::get product brands code WC 10.5.0
private function get_product_brands( $product_id ) {
return wp_get_post_terms( $product_id, 'product_brand', array( 'fields' => 'ids' ) );
}