[wp-trac] [WordPress Trac] #39965: REST API: not possible to request collection of posts across post types
WordPress Trac
noreply at wordpress.org
Thu Mar 8 17:44:51 UTC 2018
#39965: REST API: not possible to request collection of posts across post types
-------------------------+-----------------------
Reporter: iseulde | Owner: jnylen0
Type: enhancement | Status: assigned
Priority: high | Milestone: 5.0
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: rest-api | Focuses:
-------------------------+-----------------------
Comment (by joehoyle):
> Say I’m writing a post and I want to promote one of my products. I want
to link to my product. Are you really saying in Gutenberg I have to do
that manually? Do you realize this won't be very... welcomed by users?
This is still possible in the REST API, just with multiple requests. It's
up to the client on how it wants to present multiple types to the user.
There's the api client (in this case gutenberg) that can do things for the
user, like send multiple requests. Different post types can be very
different, so the client should handle these as such. For example, don't
assume you can just get "all posts across all types" and then display
them. What if a post type doesn't support titles, etc. Different post
types can be as different as a Tag and a Post, as far as the API is
concerned. That's why the suggestion is a search endpoint (or similar)
that would return multiple groupings of different objects.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39965#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list