I have a post type Properties. Property have their name(Title) image(Featured Image) and Locations(Acf Field). so i want to extract the exact property. from frontend i have a search form in which i am searching properties using location. so can i get the exact property using URL Like domain/wp-json/wp/v2/properties?acf.address_map.address="formsearchlocation so it only return the property which has the same location as i searched Using wp rest api and frontend on react so if anybody can help me out reply !!
(I don't want to fetch all location first and than filter out the specific location
try:- domain/wp-json/wp/v2/properties?acf.address_map.address="new-jersey"
Expectation :- title : Broadway Home
Image : domian/uploads/media/broadway.webp
Location : new-jersey United States
Output :- [
{
"id": 11371,
"title": "Business Address"
"acf" : {
"address_map" : {
"location" : "West 40th Street, New York, NY 10018",
}
}
},{
"id": 11352,
"title": "Prime Address"
"acf" : {
"address_map" : {
"location" : "West 40th Street, London",
}
}
},
{
"id": 11371,
"title": "Business Address 2"
"acf" : {
"address_map" : {
"location" : "East 40th Street, australia",
}
}
},{
"id": 11352,
"title": "Prime Address 2"
"acf" : {
"address_map" : {
"location" : "new-jersey United States",
}
}
},
]