[wp-trac] [WordPress Trac] #39965: REST API: not possible to request collection of posts across post types
WordPress Trac
noreply at wordpress.org
Sat Aug 26 03:18:47 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: rest-api | Focuses:
-------------------------+-----------------------
Comment (by rmccue):
I am much more in favour of a search endpoint which could search across
different types of entities, and I think that's probably a good endpoint
to have for both backend (link dialogue, etc) and frontend (site search,
autocomplete, etc) usage.
Potentially, we could add an additional context (say, `context=internal`)
to a search endpoint to allow searching types which don't have
`show_in_rest`, but we would want to very carefully consider how this
works and the use cases for it. I think a better idea is simply to require
`show_in_rest`.
A generic `/batch` could also work, but I think a targeted search endpoint
is a better fit, and it also avoids the problem of boiling the ocean (by
trying to solve one use case with a very generic fix). This also fits
nicer with things like pagination, sorting, etc.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39965#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list