WC_Product::set_category_ids
Set the product categories.
Method of the class: WC_Product{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Product = new WC_Product(); $WC_Product->set_category_ids( $term_ids );
- $term_ids(array) (required)
- List of terms IDs.
Changelog
| Since 3.0.0 | Introduced. |
WC_Product::set_category_ids() WC Product::set category ids code WC 10.5.0
public function set_category_ids( $term_ids ) {
$this->set_prop( 'category_ids', array_unique( array_map( 'intval', $term_ids ) ) );
}