Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Distance Filters › Reply To: Distance Filters
June 23, 2020 at 2:13 pm
#28052
Keymaster
Hi,
Well, I’m afraid the thing with the settings is not possible – that needs to be custom coded somehow. There is a javascript API, that may help, if you decide to try it, or if a developer may need it.
The other one with the logged in users is also a custom coding issue, but should be simpler. Based on this knowledge base, I would try something like this:
add_filter( 'asp_results', 'asp_custom_link_results', 10, 1 );
function asp_custom_link_results( $results ) {
$link = 'https://www.google.com/'; // Link to use, when not logged in
// Parse through each result item
foreach ($results as $k=>$v) {
if ( !is_user_logged_in() )
$results[$k]->link = $link;
}
return $results;
}