Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Filtering search results based on ActiveMember360 permissions › Reply To: Filtering search results based on ActiveMember360 permissions
September 19, 2019 at 2:19 pm
#24074
Keymaster
Thank you very much!
The code was actually fine, I just made a typo on line 11. I have corrected the mistake, it should work now. The final, correct code is:
add_filter('asp_results', 'asp_mbr_filter_posts', 10, 1);
function asp_mbr_filter_posts( $results ) {
foreach ( $results as $k => $r ) {
if ( !mbr_match_user_content($r->id) ) {
unset($results[$k]);
}
}
return $results;
}