Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Searchandfilter and external database

Viewing 3 posts - 1 through 3 (of 3 total)
  • Rafa Noguera
    #221374

    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

    Trevor Moderator
    #221386

    I am not sure that what you ask for is possible. I will pass the question to Ross, our developer.

    Ross Moderator
    #221496

    Hi Rafa

    Although I’ve never tried this it looks like it’s possible, see here:
    https://devblog.kommigraphics.com/wordpress/connect-another-wp-database-use-wp_query/

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.