wordpress (woocommerce) add image to media library programmatically python

So what I am trying to do is to link an image to a product in woocommerce.

first the image is downloaded by python script and put in a folder.

I’ve inserted into the DB a post of type attachment with a location to the file in it and the post parent as the product i want to link it to.

I then added the attachment id on the products post (mysql)

but the picture doesnt show up and in the media library it shows up as blank. what else do i need to do?

Read more here:: wordpress (woocommerce) add image to media library programmatically python

Leave a Reply

Your email address will not be published. Required fields are marked *