Skip to content

Commit

Permalink
Restructure args array passed when checking 'view_private_members_of_…
Browse files Browse the repository at this point in the history
…group' cap.

This is necessary because of the way that `bp_current_user_can()`
interprets an integer `$args` param as a site ID.

See cuny-academic-commons/commons-in-a-box#458.
  • Loading branch information
boonebgorges committed Nov 18, 2024
1 parent 8fbce34 commit d24a339
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buddypress/groups/single/activity-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

$group = groups_get_current_group();

if ( current_user_can( 'view_private_members_of_group', $group->id ) ) {
if ( current_user_can( 'view_private_members_of_group', [ 'group_id' => $group->id ] ) ) {
$group_private_members = [];
} else {
$group_private_members = openlab_get_private_members_of_group( $group->id );
Expand Down
2 changes: 1 addition & 1 deletion lib/group-funcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ function openlab_show_site_posts_and_comments() {

switch ( $site_type ) {
case 'local':
if ( current_user_can( 'view_private_members_of_group', $group_id ) ) {
if ( current_user_can( 'view_private_members_of_group', [ 'group_id' => $group_id ] ) ) {
$group_private_members = [];
$post__not_in = [];
} else {
Expand Down

0 comments on commit d24a339

Please sign in to comment.