Installed Profile Visibility Manager plugin and it works great. Our main goal was that we needed to be able to hide some profiles completely while keeping those people as users. Being able to hide their profiles from member search was also important. But we still need to be able to have admin level users search all profiles regardless of their visibility settings. Is this possible?
Hi Tom,
Welcome to BuddyDev.Please put this code in your bp-custom.php or your theme’s functions.php
function buddydev_disable_filtering_users() { if ( function_exists( 'bp_profile_visibility_loader' ) && current_user_can( 'manage_options' ) ) { bp_profile_visibility_loader()->set_data( 'is_visible', true );//all users will be visible } } add_action( 'bp_before_members_loop', 'buddydev_disable_filtering_users' ); //do you want to disable visibility after the loop? function buddydev_reenable_filtering_users() { if ( function_exists( 'bp_profile_visibility_loader' ) && current_user_can( 'manage_options' ) ) { bp_profile_visibility_loader()->set_data( 'is_visible', false );//all users will be visible according to their preference } } add_action( 'bp_after_members_loop', 'buddydev_reenable_filtering_users' );
It is the simplest way to enable/disable filtering.
The current_user_can() function takes capability for checking. For the Capabilities, Please see https://codex.wordpress.org/Roles_and_Capabilities
Please do let me know if it works for you or not?
The topic ‘ [Resolved] BP Profile Visibility Manager’ is closed to new replies.