Turns out someone had the same problem and answered their own problem here.
wp_set_object_terms not accepting variable array
Here’s my working solution for my problem:
$image_category = array_map('intval', $_POST['image_category']);
wp_set_object_terms($product->get_id(), $image_category, 'product_cat');
Hope this helps someone else. Thanks for reading.
Related Posts:
- Display Categories Assigned to a WooCommerce Product
- How to get woocomerce attributes thumbnail in PHP? [closed]
- How to get all attributes with their terms related to specific Woocommerce product category [closed]
- WP_Error on attribute + term insert
- WooCommerce: One term for Many Product Attributes
- Restrict product tags archive to certain users
- Split taxonomies on different pages
- Exclude Specific Product Category for showing up in its parent category page
- Display x number of terms and exclude hidden
- cannot create product attribute (taxonomy) and add terms on the same execution
- Slow Loading Attribute Select – WooCommerce Backend
- How can I define a custom template for woocommerce [products] shortcode? [closed]
- Get current WooCommerce endpoint not working
- Changing Woocommerce price display [closed]
- Which WooCommerce hook do I need to use to place the coupon field after the checkout sidebar
- WooCommerce Cart – Group Products By Category
- Set a default quantity input value for a variable product category in WooCommerce
- WooCommerce product sorting VERY slow
- WooCommerce change price in cart [closed]
- Categories not shown in admin after adding woocommerce products via wp wc cli
- Enabling autosave when plugin disabled
- WooCommerce email text based on category && shipping zone && payment method [closed]
- woocommerce – get_image_size() deprecated [closed]
- Extra row / text field to a product page (WooCommerce)
- woocommerce_email_attachments filter arguments [closed]
- Problem with cURL and rest API
- Avada & WooCommerce Customization – Replacing product_title in woo-config.php [closed]
- WooCommerce template page for category
- How to clear woocommerce checkout form after pageload
- Is there a plugin available for recurring orders in Woocommerce? [closed]
- Woocommerce PHP site that shows table with orders from specific category
- How to get the webshop page in 2:nd language, with Polylang and Hyyan
- Subcategories not working when using shared base with custom taxonomy
- Remove a higher quantity from stock according to a variation
- Auto generate user email while registration
- WooCommerce Cart Total Table chronology order change [closed]
- Woocommerce Update Order Notes Date
- Shipping Method does not inherit settings from the class
- My woocommerce checkout page and woocommerce setting page are not responding [closed]
- Woocommerce Shortcode custom orderby not working
- Show only one variaton in catalog on meta key
- Switch position of short description and variations [closed]
- Overwrite ‘require’ in child-theme
- Get specific values in Woocommerce Rest API
- Javascript error when adding an item to the cart [closed]
- Best Practice – Customise a WooCommerce+WordPress Templates
- Woocommerce: Complex query in pre_get_posts [closed]
- How can I get all the woocommerce api orders [closed]
- Is it possible to update the total price on the checkout page in woocommerce from a custom field
- Switch to user link
- Customize WooCommerce Add To Cart Form Name [closed]
- Remove WooCommerce block styles
- WooCommerce adding product to cart programatically [closed]
- Can’t find a product by SKU
- Weird strange letters appeared in all website links [duplicate]
- password_reset doesnt work
- How can I reference external attachments without breaking core WordPress files?
- Hide prices from certain category in woocommerce
- Check if a WooCommerce Order Item has a specific meta data key
- Simple Product not displaying in frontend
- WooCommerce Cart Items
- Where is this text in a wordpress email coming from? Want to change/remove
- Add starts rating in woocommerce product comment from backend
- Rewrite rules for sub category (child product categry & grand-child)
- Woocommerce show field in product if product-tag is “VET” else hide
- How to make a “subtitle” for each Woocommerce product
- Create Product with Woocommerce API, but Variations are not linked
- How to reduce checkout loading time of `?wc-ajax=checkout`
- Google Analytics gtag code messes up woocommerce cart & login
- Woocommerce API security concerns
- How to add a wrapper element on image for products page
- Dynamic subdomains for woocommerce affiliate sales but NO multisite. Is that possible?
- Woocommerce posts and products links works only once and then get 404 error
- I wan redirect link post search to search product woocommerce?
- Limit image resolution on upload file for specific field
- Woocommerce pagination problem- page/2 = 404 solution
- Woocommerce , how to set billing_address via JS?
- Using admin email in billing address
- Does WP-WooC support filters at database?
- How to send welcome email once user buys the subscription
- Removed Sidebar in single product page
- Reorder PRODUCTS in categories Woo
- Enable Payment gateway if ACF checkbox in user profile is checked
- How do you reactive related products on WooCommerce when it has been disabled?
- Retrieve Woocommerce Cart Url with javascript/jquery [closed]
- How can I locate where the actions are defined? [duplicate]
- Shortcodes in billing fields doesn’t work
- Update a user meta key based on WooCommerce product purchase
- show multiple product photos on WooCommerce single page
- deactivate product-page image slider on mobile
- How to get _POST variable on WooCommerce product page (form on homepage)
- Woocommerce woocommerce_breadcrumb_defaults filter [closed]
- Some Admin disappeared
- Sort by promo code used woocommerce admin panel [closed]
- How to manage a bookstore
- Search box missing Woocommerce Product Bundle Extension
- DatePicker in Woocommerce (My Account) Registration [closed]
- problems with an object product wooCommerce [closed]
- CSS url rules not relative to css path in account endpoint areas. IE. subscriptions
- Hide price, “add to cart” button and show message “Please log in to shop” [closed]