I am using JSON API plugin to query wordpress from a mobile app.
Currently I have a theme on my wordpress site which works as a directory returning “near me” results when a search is made. This is done using a custom search function builtin in the theme.
The function uses custom parameters to get the lat/lon
of the user and compare it to the lat/lon of each place in the wp database to sort results by distance.
The issue I am having is that when I run the get_search_results
method from the JSON API plugin
the custom parameters are ignored.
Does anyone know if there is anyway I can extend the plugin to return the same results the theme is returning when performing a search.
The plugin seems to have a way to extend controllers, but I can’t seem to get my head around on how to use that to customize the search query.
Any tip putting me in the right direction will be appreciated.
Thanks!