#48314 closed defect (bug) (duplicate)
REST endpoint for getting media will return 401 if first post to use it as featured image is in the trash
Reported by: | andregumieri | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.3 |
Component: | REST API | Keywords: | |
Focuses: | rest-api | Cc: |
Description
Version:
5.2.4
Steps to reproduce:
- Create a post
- Upload a featured image to it
- Save the post and then send it to trash
- Create a second post
- Use the same featured image as the trashed post
- Save the post
- Try to access the media through /wp-json/wp/v2/media/<id>
The result will be
{"code":"rest_forbidden","message":"Sorry, you are not allowed to do that.","data":{"status":401}}
Expectation would be to have the featured image data
Change History (3)
Note: See
TracTickets for help on using
tickets.
Thank you for your error report, @andregumieri ! This ticket is a known issue, previously tracked in #41445 — because of that, I am going to close this as a duplicate. We do appreciate your calling this bug out, and we are discussing potentially making this one of our priorities for 5.4.
If you have any interest in collaborating on a solution, I'd welcome your participation on the thread in the other ticket!