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

Reply To: Disabled pages and posts shown in search results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Disabled pages and posts shown in search results Reply To: Disabled pages and posts shown in search results

#41442
Ernest MarcinkoErnest Marcinko
Keymaster

You are welcome!

Yes, indeed there is an error in the code (as I couldn’t test it), you have corrected it properly, you can also use this version with the extra bracket for nicer encapsulation:

add_filter( 'asp_results', 'asp_digimember_access_filter', 10, 1 );
function asp_digimember_access_filter( $results ) {
  foreach ($results as $k=>&$r) {
	if ( isset($r->post_type) ) {
		if ( digimember_currentUserAccessDenied($r->post_type, $r->id) ) {
			unset($results[$k]);
		}
	}
  } 
  return $results;
}

You can disable the keyword suggestions here: https://documentation.ajaxsearchpro.com/autocomplete-and-keyword-suggestions/keyword-suggestions