diff --git a/src/bp-groups/bp-groups-template.php b/src/bp-groups/bp-groups-template.php
index c936a1fab..7bcbe96ff 100644
|
a
|
b
|
function bp_the_group() { |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
| 470 | | * Is the group visible to the currently logged-in user? |
| | 470 | * Is the group accessible to the currently logged-in user? |
| | 471 | * Despite the name of the function, it has historically checked |
| | 472 | * whether a user has access to a group. |
| | 473 | * In BP 2.9, a property was added to the BP_Groups_Group class, |
| | 474 | * `is_visible`, that describes whether a user can know the group exists. |
| | 475 | * If you wish to check that property, use the check: |
| | 476 | * bp_current_user_can( 'groups_see_group' ). |
| 471 | 477 | * |
| 472 | 478 | * @since 1.0.0 |
| 473 | 479 | * |
| … |
… |
function bp_group_is_visible( $group = null ) { |
| 485 | 491 | $group =& $groups_template->group; |
| 486 | 492 | } |
| 487 | 493 | |
| 488 | | if ( ! empty( $group->is_visible ) ) { |
| 489 | | return true; |
| 490 | | } |
| 491 | | |
| 492 | | return false; |
| | 494 | return bp_current_user_can( 'groups_access_group', array( 'group_id' => $group->id ) ); |
| 493 | 495 | } |
| 494 | 496 | |
| 495 | 497 | /** |
diff --git a/src/bp-templates/bp-nouveau/buddypress/groups/single/parts/header-item-actions.php b/src/bp-templates/bp-nouveau/buddypress/groups/single/parts/header-item-actions.php
index bee440574..0c0e6b980 100644
|
a
|
b
|
|
| 7 | 7 | ?> |
| 8 | 8 | <div id="item-actions" class="group-item-actions"> |
| 9 | 9 | |
| 10 | | <?php if ( bp_group_is_visible() ) : ?> |
| | 10 | <?php if ( bp_current_user_can( 'groups_access_group' ) ) : ?> |
| 11 | 11 | |
| 12 | 12 | <dl class="moderators-lists"> |
| 13 | 13 | <dt class="moderators-title"><?php _e( 'Group Admins', 'buddypress' ); ?></dt> |
diff --git a/src/bp-templates/bp-nouveau/includes/groups/template-tags.php b/src/bp-templates/bp-nouveau/includes/groups/template-tags.php
index f1701ef33..e2d38d51c 100644
|
a
|
b
|
function bp_nouveau_group_template_part() { |
| 1153 | 1153 | |
| 1154 | 1154 | $bp_is_group_home = bp_is_group_home(); |
| 1155 | 1155 | |
| 1156 | | if ( $bp_is_group_home && ! bp_group_is_visible() ) { |
| | 1156 | if ( $bp_is_group_home && ! bp_current_user_can( 'groups_access_group' ) ) { |
| 1157 | 1157 | /** |
| 1158 | 1158 | * Fires before the display of the group status message. |
| 1159 | 1159 | * |