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

Reply To: Search instance based restrictions with asp_results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search instance based restrictions with asp_results Reply To: Search instance based restrictions with asp_results

#24556
Ernest MarcinkoErnest Marcinko
Keymaster

Hi!

Yes, you can. There are three additional arguments to that hook, one of them is the search ID. Use this variation instead:

add_filter( 'asp_results', 'asp_number_results', 10, 4 );
function asp_number_results( $results, $search_id, $is_ajax, $search_args ) {
  if ( $search_id == 1 ) {
    foreach ($results as $k=>$v) {
      $results[$k]->link = $results[$k]->link . "?support&".$results[$k]->ID;
    }
  }
  return $results;
}

Just change the first line to the search ID you want to apply this on, and that is it.