[wp-trac] [WordPress Trac] #39640: Link href identifier for images inserted from gallery

WordPress Trac noreply at wordpress.org
Mon Feb 6 22:31:14 UTC 2017


#39640: Link href identifier for images inserted from gallery
-------------------------+-----------------------
 Reporter:  Kubbik       |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  REST API     |     Version:  trunk
 Severity:  normal       |  Resolution:  invalid
 Keywords:               |     Focuses:  rest-api
-------------------------+-----------------------
Changes (by kadamwhite):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 @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

 - its original media file (the `.source_url` property of the media record
 as returned from the API);
 - its attachment page (the `.link` property of a media record);
 - a completely custom URL, or
 - no wrapping link object.

 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/

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39640#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list