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

Reply To: How to change the results URL to something else based on the different page id

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to change the results URL to something else based on the different page id Reply To: How to change the results URL to something else based on the different page id

#27144
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

The $_GET[‘page_id’] is not available in that context, because that is an ajax request. However, the search arguments do include this:

add_filter( 'asp_results', 'asp_custom_link_results', 10, 4 );
function asp_custom_link_results( $results, $id, $is_ajax, $args ) {
	foreach ($results as $k=>&$r) {
		$r->link = 'https://google.com' . $args['_page_id'];
	}

	return $results;
}