-
Notifications
You must be signed in to change notification settings - Fork 13
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
Using in conjunction with multiple meta queries in REST url #17
Comments
Hi Reuben, I guess the https://github.com/birgire/geo-query using the PHP snippet there and then: But I'm not sure at the moment what would be the best way to handle it with I remember playing with: https://wordpress.stackexchange.com/a/178492/26350 for meta query and a simple title search. and also a way to combine two https://github.com/birgire/wp-combine-queries but these methods might not be useful here? It looks you're not using the native WP REST API filters, if I recall correctly the |
Thanks for the reply. I'll take a look at the links you sent over and see if I can possibly make a custom endpoint for this specific use case. I was just wondering though, with the custom filter for the geo-query, would it at all be possible to add in a relational meta query into the filter itself. This may be a bit out there and not possible at all, but as all I need to do it modify the lat long returned response to also include posts with a meta query value, could something like this work? `add_filter( 'rest_cause_query', function( $args, $request ) {
}, 10, 2 );` Or would this require configuration of the plugin itself? |
Actually clearly that would require re-writing the plugin. It would be good if it were possible to have the geo-query as part of the |
Is it possible to use this query in conjunction with other meta queries with a relation of OR?
For example, I need to pull in a bunch of listings based on their lat and long values, but also need to include all listings with a listing_type of 'National' and 'State-wide'.
I currently query the National and State-wide listings via this filter in the url:
'?filter[meta_query][relation]=OR&filter[meta_query][0][key]=state_wide_state&filter[meta_query][0][value]=' + this.state + '&filter[meta_query][1][key]=cause_type&filter[meta_query][1][value]=National'
Is there a way I can use this geo-query as another meta_query or combine them in some way?
Many thanks
Reuben
The text was updated successfully, but these errors were encountered: