Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/01/2018 08:10:42 PM (8 years ago)
Author:
boonebgorges
Message:

Groups: Admin/mod queries should respect when a group has no admins/mods.

Without this patch, groups without admins or mods can trigger a lookup of
every user on the installation.

Props cyclic.
Fixes #7677.

File:
1 edited

Legend:

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

    r11805 r11838  
    561561        $mod_ids_plucked = wp_list_pluck( $mod_ids, 'user_id' );
    562562
    563         $admin_mod_users = get_users( array(
    564             'include' => array_merge( $admin_ids_plucked, $mod_ids_plucked ),
    565             'blog_id' => null,
    566         ) );
     563        $admin_mod_ids = array_merge( $admin_ids_plucked, $mod_ids_plucked );
     564        $admin_mod_users = array();
     565
     566        if ( ! empty( $admin_mod_ids ) ) {
     567            $admin_mod_users = get_users( array(
     568                'include' => $admin_mod_ids,
     569                'blog_id' => null,
     570            ) );
     571        }
    567572
    568573        $admin_objects = $mod_objects = array();
Note: See TracChangeset for help on using the changeset viewer.