- This topic has 1 reply, 2 voices, and was last updated 2 years, 3 months ago by .
I have a Meta Box added custom post type called ‘house’ and it contains two custom fields (added via Meta Box) that has the ‘street_name’ and ‘city’ for a given house.
When I query the WP REST API end point for this custom post type, I get all houses and it’s not clear from the documentation how I can pass my custom field preference to the end point so that I only get the houses that match the street_name and city I provide it.
So my question is, how do I retrieve a house via the API by filtering using the two custom fields?
I’ve tried to use the WP REST Filter plugin (to restore filter function removed in WP 4.7) and am trying to query the endpoint like this: /house?filter[meta_query][relation]=AND&filter[meta_query][key]=street_name&filter[meta_query][value]=Evergreen+Terrace&filter[meta_query][key]=city&filter&[meta_query][value]=Springfield
Thank you in advance for the help!
- You must be logged in to reply to this topic.