[wp-trac] [WordPress Trac] #64034: Media / Attachments REST API endpoint: Include post (i.e. attached parent) as an embeddable link in the response

WordPress Trac noreply at wordpress.org
Wed Sep 24 02:46:29 UTC 2025


#64034: Media / Attachments REST API endpoint: Include post (i.e. attached parent)
as an embeddable link in the response
--------------------------+--------------------
 Reporter:  andrewserong  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  6.9
Component:  REST API      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+--------------------
 In the Media / Attachments REST API endpoint, can we include the `post`
 (i.e. attached parent or "uploaded to") in the response, as a link under
 `_links`?

 The goal here is to make it easier to display or work with the "uploaded
 to" / "attached to" field of media via the REST API endpoint, as part of
 exploring a new media library.

 In my explorations so far, it will be a fair bit easier to work with if we
 can include a link in the API response to the `post` that the media item
 is associated with, as we'd then be able to query the endpoint with
 `_embed: 'post'` to list out the post title that media is linked to.

 For context, the new media library is being proposed in
 https://github.com/WordPress/gutenberg/issues/55238, where an Attached to
 / Uploaded to field will be required.

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


More information about the wp-trac mailing list