Skip to:
Content

BuddyPress.org

Changeset 11100


Ignore:
Timestamp:
09/14/2016 01:34:44 AM (9 years ago)
Author:
boonebgorges
Message:

Groups: Eliminate the populate_extras option from the bp_has_groups() stack.

Fun fact: Now that all these values are cached and lazy-loaded, the
parameter no longer does anything. Begone!

See #5451.

Location:
trunk/src/bp-groups
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-functions.php

    r11095 r11100  
    712712        'per_page'           => 20,             // The number of results to return per page.
    713713        'page'               => 1,              // The page to return if limiting per page.
    714         'populate_extras'    => true,           // Fetch meta such as is_banned and is_member.
    715714        'update_meta_cache'  => true,           // Pre-fetch groupmeta for queried groups.
    716715        'update_admin_cache' => false,
     
    733732        'per_page'           => $r['per_page'],
    734733        'page'               => $r['page'],
    735         'populate_extras'    => $r['populate_extras'],
    736734        'update_meta_cache'  => $r['update_meta_cache'],
    737735        'update_admin_cache' => $r['update_admin_cache'],
  • trunk/src/bp-groups/bp-groups-template.php

    r11095 r11100  
    135135 *     @type array|string $include            Array or comma-separated list of group IDs. Results will be limited
    136136 *                                            to groups within the list. Default: false.
    137  *     @type bool         $populate_extras    Whether to fetch additional information (such as member count)
    138  *                                            about groups. Default: true.
    139137 *     @type array|string $exclude            Array or comma-separated list of group IDs. Results will exclude
    140138 *                                            the listed groups. Default: false.
     
    206204        'exclude'            => false,
    207205        'parent_id'          => null,
    208         'populate_extras'    => true,
    209206        'update_meta_cache'  => true,
    210207        'update_admin_cache' => bp_is_groups_directory() || bp_is_user_groups(),
     
    231228        'exclude'            => $r['exclude'],
    232229        'parent_id'          => $r['parent_id'],
    233         'populate_extras'    => (bool) $r['populate_extras'],
    234230        'update_meta_cache'  => (bool) $r['update_meta_cache'],
    235231        'update_admin_cache' => (bool) $r['update_admin_cache'],
  • trunk/src/bp-groups/classes/class-bp-groups-group.php

    r11095 r11100  
    882882     *     @type array|string $parent_id          Optional. Array or comma-separated list of group IDs. Results
    883883     *                                            will be limited to children of the specified groups. Default: null.
    884      *     @type bool         $populate_extras    Whether to fetch additional information
    885      *                                            (such as member count) about groups. Default: true.
    886884     *     @type array|string $exclude            Optional. Array or comma-separated list of group IDs.
    887885     *                                            Results will exclude the listed groups. Default: false.
     
    936934            'include'            => false,
    937935            'parent_id'          => null,
    938             'populate_extras'    => true,
    939936            'update_meta_cache'  => true,
    940937            'update_admin_cache' => false,
     
    11491146        foreach ( (array) $paged_groups as $group ) {
    11501147            $group_ids[] = $group->id;
    1151         }
    1152 
    1153         // Populate some extra information instead of querying each time in the loop.
    1154         if ( !empty( $r['populate_extras'] ) ) {
    1155             $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, $r['type'] );
    11561148        }
    11571149
  • trunk/src/bp-groups/classes/class-bp-groups-member-suggestions.php

    r11091 r11100  
    9393        $user_query = array(
    9494            'count_total'     => '',  // Prevents total count.
    95             'populate_extras' => false,
    9695            'type'            => 'alphabetical',
    9796
     
    116115            $group_query = array(
    117116                'count_total'     => '',  // Prevents total count.
    118                 'populate_extras' => false,
    119117                'type'            => 'alphabetical',
    120118
  • trunk/src/bp-groups/classes/class-bp-groups-template.php

    r11095 r11100  
    172172            'group_type__not_in' => '',
    173173            'meta_query'         => false,
    174             'populate_extras'    => true,
    175174            'update_meta_cache'  => true,
    176175            'update_admin_cache' => false,
     
    227226                'exclude'            => $exclude,
    228227                'parent_id'          => $parent_id,
    229                 'populate_extras'    => $populate_extras,
    230228                'update_meta_cache'  => $update_meta_cache,
    231229                'update_admin_cache' => $update_admin_cache,
Note: See TracChangeset for help on using the changeset viewer.