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 18, 2019 at 2:26 pm
#24034
Keymaster
Thank you, that worked perfectly.
So, I inspected the activemember API via their source code, and I may have found the solution. I have placed the following custom code to the functions.php file in your active child-theme directory:
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($resuls[$k]);
}
}
return $results;
}
There was no documentation about this in their API, so I can only hope this is the correct function to use.