Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rest_query_vars #2

Open
timalbert opened this issue Dec 8, 2016 · 5 comments
Open

rest_query_vars #2

timalbert opened this issue Dec 8, 2016 · 5 comments

Comments

@timalbert
Copy link

Any way the rest_query_vars filter can be added back. I am hampered by missing ability to add meta_key/value to filter.

@chrishaff
Copy link

YES! I am passing the below to no effect.

filter[date_query][column]=post_modified_gmt&filter[date_query][after]=2016-12-20T17:51:38

@stellarcowboy
Copy link

You have to add the capabilities to the query vars filter: #3 (comment)

@temsool
Copy link

temsool commented Apr 20, 2017

function my_rest_query_vars($valid_vars) { $valid_vars = array_merge($valid_vars, array('meta_key', 'meta_value', 'date_query', 'meta_query')); return $valid_vars; } add_filter('rest_query_vars', 'my_rest_query_vars');

This code not works anymore!
After upgrade to WP 4.7 this is not working, and if you install this rest filter plugin will not work!
Just need to replace line 42 with this:
rest_query_vars rather than query_vars

WP-API/WP-API#2452 (comment)

@jacktator
Copy link

In case anyone else's still looking, Check out my WP REST Filter plugin.
It supports Custom Post Type & Advanced Custom Field.
See if it does the job for you!

@mgiraldo
Copy link

@jacktator this is close to what i need but i want to filter the categories endpoints. i tried the plugin with those and it didnt seem to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants