Skip to:
Content

BuddyPress.org

Changeset 11526


Ignore:
Timestamp:
04/05/2017 08:04:10 PM (9 years ago)
Author:
boonebgorges
Message:

Specify that group admin/mod queries should be blog-independent.

On Multisite, get_users() queries are limited to the current site, unless
otherwise specified. Since group membership is independent of WP site
roles/caps, we should opt out of this limitation.

Fixes #7497.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/classes/class-bp-groups-group.php

    r11525 r11526  
    536536                $admin_mod_users = get_users( array(
    537537                        'include' => array_merge( $admin_ids_plucked, $mod_ids_plucked ),
     538                        'blog_id' => null,
    538539                ) );
    539540
  • trunk/tests/phpunit/testcases/groups/class-bp-groups-group.php

    r11523 r11526  
    14491449
    14501450        /**
     1451         * @ticket BP7497
     1452         */
     1453        public function test_admins_property_should_match_users_without_wp_role() {
     1454                $user_1 = $this->factory->user->create_and_get();
     1455                $g = $this->factory->group->create( array(
     1456                        'creator_id' => $user_1->ID,
     1457                ) );
     1458
     1459                $user_1->remove_all_caps();
     1460
     1461                $group = new BP_Groups_Group( $g );
     1462
     1463                $this->assertEqualSets( array( $user_1->ID ), wp_list_pluck( $group->admins, 'user_id' ) );
     1464        }
     1465
     1466        /**
    14511467         * @ticket BP5451
    14521468         */
Note: See TracChangeset for help on using the changeset viewer.