[wp-trac] [WordPress Trac] #58710: REST: media (images) deleted or replaced are returned by their new id when requested by their old id

WordPress Trac noreply at wordpress.org
Tue Jul 4 12:08:44 UTC 2023


#58710: REST: media (images) deleted or replaced are returned by their new id when
requested by their old id
--------------------------+-----------------------------
 Reporter:  vialars       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  6.2.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 An article has got a featured image assigned (id X).

 The featured image is replaced* using Media library (id Y).

 REST API for article delivers old image id (X).

 Upon requesting fields (id, src) for old image id (X) from REST API media
 endpoint, the field id returned is the new image id (Y).

 I expect the requested id and the returned id to match.

 Alternatively I like to be able to get to know which id returned
 correlates to which id requested.

 Example: https://deananddavid.com/wp-
 json/wp/v2/media/?include=77793&_fields=id,source_url&per_page=100

 "include" as per documentation requests certain ids. Notice the returned
 id is 77795 (5 instead 3 at last digit).


 '* the replacement was done by an editor. I don't know the exact procedure
 she/he took.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58710>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list