[wp-trac] [WordPress Trac] #39965: REST API: not possible to request collection of posts across post types

WordPress Trac noreply at wordpress.org
Wed Jul 26 14:22:18 UTC 2017


#39965: REST API: not possible to request collection of posts across post types
-------------------------+-----------------------
 Reporter:  iseulde      |       Owner:  jnylen0
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  4.9
Component:  REST API     |     Version:  4.7
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+-----------------------

Comment (by danielbachhuber):

 Replying to [comment:3 jnylen0]:
 > Let's look into this for 4.9.
 >
 > I'm thinking that `/wp/v2/posts` should support a special argument like
 `?any_type=true` or perhaps `?type=post,page`, `?type=*`.  There may be
 some difficulties due to differences in response structure (in core, posts
 and pages are somewhat different, and attachments are very different).

 For the record, this violates the principles of REST and I generally think
 it's a really bad idea.

 Creating some batch `GET` endpoint would be another approach:
 https://github.com/WP-API/WP-API/issues/1506 GraphQL would be the
 inevitable conclusion.

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


More information about the wp-trac mailing list