This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Integrating ASP results with BuddyBoss Search Component's Results Template

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Integrating ASP results with BuddyBoss Search Component's Results Template Reply To: Integrating ASP results with BuddyBoss Search Component's Results Template

#35089
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

This might be a bit more complicated than this. Ajax Search Pro also does a few major checks before initiating the search override feature, so simply adding the query arguments may not do anything.

My recommendation would be to somehow somewhere (probably into the do_search() function) initiate the Ajax Search Pro search query manually:

$search_id = 1;
$args = array(
	"s" => $phrase,
	"_ajax_search" => false,
	"posts_per_page" => 20,
	"page"  => isset( $_GET['paged'] ) ? $_GET['paged'] : 1
);
$asp_query = new ASP_Query($args, $search_id);
$results = $asp_query->posts;

Here you need to set the correct $search_id (is the shortcode id here), and the search $phrase
Then the $results array will contain the results for the $phrase based on the search configuration.

You could then either use this to print the results, or gather their IDs via a foreach loop and then pass them forward, depending on how the rest of the code works.