Hi, we are developing a master website that has the master data. Additionally, there are satellite websites that read data from master website. We use your plugin searchandfilter, and we need to connect searchandfilter of satellite websites to master data, so we need to do an external database connection with this method:
function get_maps( $data ) {
$args = array (
‘search_filter_id’=>27169,
‘posts_per_page’=>-1,
‘numberposts’ => -1,
);
$query = new WP_Query($args);
/*here I get the results of the query*/
return $data;
}
add_action( ‘rest_api_init’, function () use () {
register_rest_route( ‘search-and-filter/v1’, ‘/map/’, array(
‘methods’ => ‘GET’,
‘callback’ => ‘get_maps’
)
);
});
Can you orientate us if there is a good way to do this please?
Regards,
Mariano