#39640 closed enhancement (invalid)
Link href identifier for images inserted from gallery
Reported by: | Kubbik | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.8 |
Component: | REST API | Keywords: | |
Focuses: | rest-api | Cc: |
Description
Change History (3)
This ticket was mentioned in Slack in #core-restapi by kadamwhite. View the logs.
8 years ago
#2
@
8 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
#3
@
8 years ago
If this information were to be included in the REST API, it would be much, much later, as part of the final stages of the block-based editor project: https://make.wordpress.org/core/2017/01/17/editor-technical-overview/
There could be an API endpoint that returns the list of blocks associated with a post's content, and this "link type" could be a property of the block information for an "attachment" block that has been inserted into the post.
Note: See
TracTickets for help on using
tickets.
@Kubbik Thank you for using the REST API, and for your question! The dropdown you are referencing is part of the media UI, not specifically a part of the REST API itself; the value comes from a user UI preferences object that is specific to the WordPress Admin and not related to the REST API. To explain, for any media item, you may insert it into the post using either
.source_url
property of the media record as returned from the API);.link
property of a media record);The value you select is not stored as part of the media object, so it would not make sense to return it in the response from the media endpoint within the REST API. It is up to the UI of your application to provide this sort of interface when inserting an image. Once inserted, it is possible to infer what option a user selected by comparing the
href
value to the.link
or.source_url
properties; if it matches one of those it is a link to the media file or attachment page, otherwise it is a custom link (or not present at all).I am going to close this issue as it does not reflect a defect of the REST API. Thanks again, and if you have further questions, please let us know in the support forums at https://wordpress.org/support/