[wp-trac] [WordPress Trac] #50409: REST API about links should be embeddable.

WordPress Trac noreply at wordpress.org
Wed Jun 17 15:28:58 UTC 2020


#50409: REST API about links should be embeddable.
-------------------------+------------------------------
 Reporter:  herregroen   |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  REST API     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  rest-api
-------------------------+------------------------------

Comment (by TimothyBlynJacobs):

 >  in which case you may also receive other information in duplicate.

 In those cases the information ''may'' be duplicate information but only
 if the property is identical in each post and in this case you cannot
 possibly know what that information will be since it depends on the post
 object.

 In other words, if embedding wasn't a thing, and you wanted to fetch the
 post author's information you'd first have to request the post object,
 find the `author` property and then make a new request to
 `wp/v2/users/<author>`.

 My point about this case is that since the information belongs to the post
 type, it would necessarily be identical for every post and you already
 know where to find that information. You can make a request at the same
 time to `wp/v2/types/<cpt>` as you make a call to `wp/v2/<cpt>/<id>`.

 A nice enhancement would be to allow for marking links as embeddable but
 not having them embedded by default, but if you requested the relation
 specifically with `_embed=rel` it would be included. We could probably
 just support that for all internal links.

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


More information about the wp-trac mailing list