woocommerce / woocommerce-rest-api

This is the WooCommerce core REST API Package. It runs standalone as a feature plugin too.
70 stars 46 forks source link

Avoid image duplication if images are already available in wordpress media #281

Closed iwkse closed 2 years ago

iwkse commented 2 years ago

Adding images for a product requires to be a URL and not a URI (would be great to just use file:// and upload from local). Using Wordpress Rest API to upload images on media, than use such URL in the product images will upload again the images already present in media. It would be great to allow local upload or avoid the duplication of images if they are already in media.

iwkse commented 2 years ago

I just figured out that it searches for the 'id' key, so passing that in the array will avoid re-uploading.