Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Filter search results based on authentication status › Reply To: Filter search results based on authentication status
August 17, 2020 at 7:45 pm
#29018
Participant
He Ernest
MemberPress support suggested trying MeprRule::is_locked($r)
function asp_fix_groups_exclusions($results) {
// Group based exclusions
if ( class_exists('MeprRule') ) {
foreach ($results as $k => &$r) {
if ( isset($r->post_type) && MeprRule::is_locked($r) )
unset($results[$k]);
}
}
return $results;
}
add_filter('asp_results', 'asp_fix_groups_exclusions', 10, 1);
This had no effect, all results were returned to all users. Do you see any issues with the code? This was placed in a child theme’s functions.php.
Thanks