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

Reply To: Filter search results based on authentication status

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

#29018
philip29philip29
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