[wp-trac] [WordPress Trac] #38579: REST API: Allow listing posts that match any of a set of slugs rather than just one
WordPress Trac
noreply at wordpress.org
Sun Oct 30 23:50:34 UTC 2016
#38579: REST API: Allow listing posts that match any of a set of slugs rather than
just one
-------------------------------------------------+-------------------------
Reporter: jnylen0 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: REST API | Review
Severity: normal | Version: trunk
Keywords: has-patch has-unit-tests reporter- | Resolution:
feedback | Focuses:
-------------------------------------------------+-------------------------
Changes (by rachelbaker):
* keywords: has-patch has-unit-tests => has-patch has-unit-tests reporter-
feedback
* type: defect (bug) => enhancement
Comment:
@jnylen0 This is not a bug. This is intentional behavior based on
WP_Query and it's public query vars. See:
https://codex.wordpress.org/Class_Reference/WP_Query#Post_.26_Page_Parameters
`name` is a public WP_Query string argument for returning the one item
that matches a given post slug. `post_name__in`is a private WP_Query
array argument.
We do not want to remove the `name` collection argument at all. You can
still use `post_name__in` with authenticated users OR by adding it to the
`rest_query_vars` filter.
I am not convinced there is a big enough need to support the
`post_name__in` query argument across all installs. Can you give me some
use-cases?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38579#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list