I have a function that is being called whenever a woocommerce product is published (through the
This function uploads a few images, attaches them to the current post being saved (using
update_post_meta with the
_product_image_gallery key and
If I create and publish a product through the wp admin dashboard, this works great, no issues.
If I create a product through the REST API, the images get uploaded (so my function on the
save_post hook is being called), but the image ID’s do not get saved in the database.
update_post_meta function on the rest API call does return a meta ID, however searching in the
wp_postmeta table, this ID is not to be found..
I feel like the REST API is somehow overwriting/deleting my
update_post_meta call, and am curious if anyone else has ever ran into the same issue or has any workaround for this.