Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Compliance with Buddypress Private Profiles › Reply To: Compliance with Buddypress Private Profiles
November 29, 2019 at 9:26 am
#24814
Keymaster
Hi Lyss,
Thank you very much. Well, a custom code will be required unfortunately.
Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter('asp_results', 'asp_filter_users_by');
function asp_filter_users_by($results) {
foreach ($results as $k => &$r) {
if ( $r->content_type == 'user' ) {
$v = get_user_meta($r->id, 'yz_enable_private_account', true);
if ( $v == 'on' ) {
unset($results[$k]);
}
}
}
return $results;
}
Please be careful, I obviously was not able to test this code. Thank you!