[wp-trac] [WordPress Trac] #39696: REST API: Filter which links get embedded when passing the ?_embed query parameter

WordPress Trac noreply at wordpress.org
Sat Feb 18 20:09:06 UTC 2017


#39696: REST API: Filter which links get embedded when passing the ?_embed query
parameter
-------------------------------------------------+-------------------------
 Reporter:  rheinardkorf                         |       Owner:  jnylen0
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
Component:  REST API                             |  Release
 Severity:  normal                               |     Version:  4.4
 Keywords:  has-patch has-unit-tests needs-      |  Resolution:
  refresh                                        |     Focuses:  rest-api
-------------------------------------------------+-------------------------

Comment (by jnylen0):

 Replying to [comment:25 westonruter]:
 > On a related note, it would be great if in addition to indicating a
 embed subsetting if we could use a similar construct to indicate that
 resources should be embedded recursively along a specified tree. For
 example, if I wanted to get the recent posts along with their comments
 embedded and the embedded comments' own authors also embedded a third
 level down, maybe I could do so with a request like:
 >
 > `/wp/v2/posts?_embed[]=comments/author`
 >
 > I understand this is maybe encroaching on GraphQL territory, but just
 wanted to mention recursive embedding as the flip side of being able to
 limit embedding. This is also encroaching on batch requests as well I
 suppose.

 I'm not totally sold on this, like you said this sort of thing feels like
 a better fit for a full-fledged query language, rather than a stopgap
 measure for one specific case.

 Another potential drawback of this approach is if there is a way to embed
 a very large number of objects in a single request.  We would need to
 limit this somehow, otherwise we would be providing a convenient way to
 take up a bunch of server resources with a single request.

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


More information about the wp-trac mailing list