A
A
Andrey2020-03-04 20:57:35
RESTful API
Andrey, 2020-03-04 20:57:35

How to update image in wordpress via rest api?

The site is written in WordPress. There are products with pictures. How to update product images? I get the ID of the picture, I do it like here https://wp-kama.ru/handbook/rest/wp-routes/media, but the picture itself is not updated. This is the problem, how to be, what to read / watch?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pashenka, 2020-03-04
@alexsandrinia

How is it - how is it?
1. The image is loaded via the /media route , thus the ID of this attachment becomes known.
2. The attachment ID is attached to the post (which field already depends on what we are dealing with at all - it looks easy in the database), which needs it by updating the post along the post_type/post_id route

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question