Tagged: Group Members
Hello Simon,
Thank you for telling me. Please use the following code it will hide the members tab except for super admin or group admin.
add_action( 'groups_setup_nav', function () { if ( is_super_admin() || groups_is_user_admin( get_current_user_id(), bp_get_current_group_id() ) ) { return; } // If will hide members tab for all users. You can place conditions whom to show or hide this group. bp_core_remove_subnav_item( bp_get_current_group_slug(), 'members', 'groups' ); } );
Regards
RaviHi Ravi, question again I was wondering how to hide the members tab per name of the group…
I’m trying on this code but it does not work on my end.
add_action( ‘groups_setup_nav’, function () {
$specialgroup = array(“Test Group”,”Test Group 1″); //or group IDs or group names
if ( bp_get_group_name($specialgroup)) {
return;
}bp_core_remove_subnav_item( bp_get_current_group_slug(), ‘members’, ‘groups’ );
} );Wondering if you can enlighten or help me with code above? Thank you very much again!
Hello Simon,
Try the following code:
add_action( 'groups_setup_nav', function () { if ( is_super_admin() || groups_is_user_admin( get_current_user_id(), bp_get_current_group_id() ) ) { return; } $excluded_names = array( 'Test Group', 'Test Group 1' ); if ( in_array( bp_get_current_group_name(), $excluded_names ) ) { // If will hide members tab for all users. You can place conditions whom to show or hide this group. bp_core_remove_subnav_item( bp_get_current_group_slug(), 'members', 'groups' ); } } );
Regards
Ravi
The topic ‘ [Resolved] Hide Members List in Groups’ is closed to new replies.