-
Notifications
You must be signed in to change notification settings - Fork 657
Query params for collections #924
Comments
Punting to Beta 2. |
Slug searches are cumbersome; filtering was originally added in WP-API/WP-API#924 but has been removed again in the v2 betas (see WP-API/WP-API#924 for latest status) Integration tests demonstrate the best option we currently have, which is to search for the term then iterate through the responses from that search until you find a match.
What was the specific reason to remove |
Posts don't support |
Well yes, but there are tons of plugins that do provide a menu_order. In the previous beta menu_order was still allowed, but now it's blocked. Do you know what's the proper way for me to re-enable that again (just for myself)? |
Hey - just asking to confirm: Right now will filtering a CPT to those with a specific parent ID not work? For example: If not, do you know if this is something in progress? I can help achieve this if you need an extra hand |
You should be able to use
It should work — the filter key is |
@danielbachhuber Thanks fore getting back to me! Unfortunately that doesn't seem to be working for CPTs. I've not modified the returned data (etc.) which is weird. When I try what you've written, I just get |
Just to let you know, this is definitely an issue. When trying to filter by ID ( When trying to filter by post parent (as above in previous reply) it returns a blank array. |
@joneslloyd id isn't a WP_Query param nor do I believe there is an id param being added to filter as a mask for the WP_Query params. So I am pretty sure filter[id] doesn't work causing everything to be returned. To do what you are trying to do I highly recommend this. /wp/v2/my-cpts/333 or if you want filter it could be /wp/v2/my-cpts?filter[p]=333.
I can check about the use of post_parent and see if I can duplicate an empty result set. @joneslloyd please open this in a separate issue if you want it addressed though this is a master reference and not intended for these kind of discussions. |
We're closing this ticket out in favour of more concrete tickets instead. If you have anything you need with params, please file a new issue. |
If you have a bug to report relating to querying for posts, terms, users, comments, etc., please open a new issue — this issue is intended to be a master reference.
This issue is a master issue representing work on query parameters in collections. Here's a table of the currently supported parameters:
Related #605
The text was updated successfully, but these errors were encountered: