diff --git a/buddypress/groups/single/activity-list.php b/buddypress/groups/single/activity-list.php index fc245be..3dfb94d 100644 --- a/buddypress/groups/single/activity-list.php +++ b/buddypress/groups/single/activity-list.php @@ -14,7 +14,7 @@ $group = groups_get_current_group(); $group_url = bp_get_group_permalink( $group ); - if ( current_user_can( 'bp_moderate' ) || groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) { + if ( current_user_can( 'view_private_members_of_group', $group->id ) ) { $group_private_members = []; } else { $group_private_members = openlab_get_private_members_of_group( $group->id ); diff --git a/buddypress/groups/single/members.php b/buddypress/groups/single/members.php index fb1f8ac..72128a0 100755 --- a/buddypress/groups/single/members.php +++ b/buddypress/groups/single/members.php @@ -6,7 +6,7 @@ $private_users = openlab_get_private_members_of_group( bp_get_current_group_id() ); // If user is not mod and there are private users, exclude them from the list -if ( ! current_user_can( 'bp_moderate' ) && ! empty( $private_users ) ) { +if ( ! current_user_can( 'view_private_members_of_group' ) && ! empty( $private_users ) ) { $members_args['exclude'] = $private_users; } diff --git a/lib/group-funcs.php b/lib/group-funcs.php index c62349f..f8f04a8 100644 --- a/lib/group-funcs.php +++ b/lib/group-funcs.php @@ -1792,7 +1792,7 @@ function openlab_show_site_posts_and_comments() { switch ( $site_type ) { case 'local': - if ( current_user_can( 'bp_moderate' ) || groups_is_user_member( bp_loggedin_user_id(), $group_id ) ) { + if ( current_user_can( 'view_private_members_of_group', $group_id ) ) { $group_private_members = []; $post__not_in = []; } else { diff --git a/lib/menus.php b/lib/menus.php index c4e3762..f149bd8 100644 --- a/lib/menus.php +++ b/lib/menus.php @@ -886,8 +886,8 @@ function openlab_filter_subnav_members( $subnav_item ) { // Get a member count for formatting. $total_mem = (int) groups_get_groupmeta( bp_get_current_group_id(), 'total_member_count' ); - if ( ! current_user_can( 'bp_moderate' ) ) { - $private_users = openlab_get_private_members_of_group( bp_get_current_group_id() ); + if ( ! current_user_can( 'view_private_members_of_group' ) ) { + $private_users = openlab_get_private_members_of_group( bp_get_current_group_id(), false ); if ( $private_users ) { $total_mem -= count( $private_users ); }