[wp-trac] [WordPress Trac] #49985: REST API: Using _embed and _fields query parameters in the same query

WordPress Trac noreply at wordpress.org
Thu Apr 23 16:26:22 UTC 2020


#49985: REST API: Using _embed and _fields query parameters in the same query
-----------------------------+------------------------------
 Reporter:  anouarbenothman  |       Owner:  (none)
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  REST API         |     Version:  5.4
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  rest-api
-----------------------------+------------------------------

Comment (by ocean90):

 Hello @anouarbenothman, welcome to Trac!

 Thanks for the report. I noticed this a while ago too but seems like I
 never created a ticket for it. The workaround is to include `_links` in
 the fields too so you get at least all embed data.

 No embed: https://wordpress.org/news/wp-
 json/wp/v2/posts?_embed=true&_fields=id,title
 With embed: https://wordpress.org/news/wp-
 json/wp/v2/posts?_embed=true&_fields=id,title,_links

 #49538 is about getting only a subset of the embed data.

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


More information about the wp-trac mailing list