Using v2 of the REST API, I'm wanting to query some posts by multiple meta keys. With v1 I was able to format the url like
&filter[meta_value][month]=12&[meta_value][year]=2015 and it worked (after exposing the meta values to the API).
Now with v2, I can only get this to work by using the methods listed on this GitHub thread: https://github.com/WP-API/WP-API/issues/1599#issuecomment-161166805
Basically, added the meta fields using the
rest_query_vars filter like:
add_filter( 'rest_query_vars', 'flux_allow_meta_query' );
function flux_allow_meta_query( $valid_vars )
$valid_vars = array_merge( $valid_vars, array( 'meta_key', 'meta_value', 'meta_compare' ) );
With that, I can filter by one meta key using a url like
However, it sounds like the only way to filter on multiple meta keys is to write a custom filter. Could someone point me in the right direction of doing that?