rest-filter icon indicating copy to clipboard operation
rest-filter copied to clipboard

rest_query_vars

Open timalbert opened this issue 9 years ago • 5 comments

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

timalbert avatar Dec 08 '16 16:12 timalbert

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

chrishaff avatar Dec 15 '16 23:12 chrishaff

You have to add the capabilities to the query vars filter: https://github.com/WP-API/rest-filter/issues/3#issuecomment-268342560

stellarcowboy avatar Feb 17 '17 15:02 stellarcowboy

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

https://github.com/WP-API/WP-API/issues/2452#issuecomment-295786528

LeMiira avatar Apr 20 '17 15:04 LeMiira

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!

jacktator avatar Jan 18 '18 12:01 jacktator

@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

mgiraldo avatar Jan 31 '18 18:01 mgiraldo