Hello Tejas you may please alter your code below and let me know if it worked for you .
foreach ($files['name'] as $key => $value) {
$file = array(
'name' => $files['name'][$key],
'type' => $files['type'][$key],
'tmp_name' => $files['tmp_name'][$key],
'error' => $files['error'][$key],
'size' => $files['size'][$key]
);
$_FILES = array ("files" => $file);
foreach ($_FILES as $file => $array) {
$newupload = my_handle_attachment($file,$post_id);
}
array_push($gallery,$newupload);
}
update_post_meta($post_id,'_product_image_gallery', implode(',',$gallery));
Related Posts:
- WooCommerce conditional meta query
- How to add multiple product gallery images from front-end
- WooCommerce: Adding Order Item Meta Data That’s Hidden
- Target WooCommerce Product Gallery Image (rather than Featured Image) for og:image
- WP_Query with meta_query for children
- How to update custom field in WooCommerce
- Set default value field meta_Value [closed]
- update_post_meta not work [closed]
- WooCommerce order refund get qty refunded
- WooCommerce Bookings Plugin Not Saving Order ID
- Conditionally run function based on custom meta value?
- Next/Previous Product with custom order by price & products inside the product category [closed]
- How to add custom checkboxes from loop to WooCommerce product variation options?
- How to save a Woocomerce metabox input as a metadata field
- Can’t update WooCommerce payment method title
- Add class to latest item Woocommerce
- show multiple product photos on WooCommerce single page
- Update Custom Post Meta Even if Draft
- How to programatically create a WooCommerce downloadable product?
- How do I change the woocommerce product gallery to show all thumbnails instead of three at a time in a carousel?
- WooCommerce wp_insert_post action firing on every save
- Updating order meta to have a meta entry from an item in the order
- acf_form() – “On Update” action [closed]
- Slow Loading Attribute Select – WooCommerce Backend
- How can I define a custom template for woocommerce [products] shortcode? [closed]
- wp_insert_post() getting slower the more posts
- Display Categories Assigned to a WooCommerce Product
- 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]
- Problem with cURL and rest API
- Avada & WooCommerce Customization – Replacing product_title in woo-config.php [closed]
- WooCommerce template page for category
- 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
- Get product variation attribute titles – WooCommerce
- user password reset e-mail
- Extending the woocommerce product export functionality
- Woo Related Products How to override the plugin script?
- Line break on Product details [closed]
- WooCommerce add class name in the list [closed]
- How to display Woocommerce variations prices and descriptions
- Adding Transaction-Specific Conversion Tracking from Adwords into WooCommerce
- New field on checkout is shown but it’s not saved on the order details [closed]
- Woocommerce altered my homepage, and I can’t figure out how to revert it [closed]
- Woocommerce – Problem sorting and filtering products with different tax rates by price [closed]
- Why does my loop breaks the css below?
- How to add order status class to the body tag?
- Absolute search against wordpress api
- Is it possible to remove editor from a custom product type?
- Show password while you are typing it on the “my account” login page
- /page/ is not working with a custom permalink structure (WooCommerce)
- Where is this text in a wordpress email coming from? Want to change/remove
- Add starts rating in woocommerce product comment from backend
- Need to check if user has completed a woo commerce payment
- 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`
- unable to customize query to get filtered products by meta_key
- Woocommerce + Google Analytics (Conversion Rate Not Working)
- Update user meta when customer update their first name
- 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
- 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?
- Display product variations in shop page
- 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
- Easy Image Gallery – Retrieve Serialized Data
- How to get _POST variable on WooCommerce product page (form on homepage)
- Sort by promo code used woocommerce admin panel [closed]
- 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
- Adding a column to woocomerce admin order page that can be sorted
- Auto generating API keys using the Application Authentication Endpoint [closed]
- Is there a way to conditionally check if i’m on product variation page url like mydomain.com/myproduct?attribute_pa_color=red
- Add custom ID to WooCommerce product tab