Skip to:
Content

BuddyPress.org

Changeset 7461


Ignore:
Timestamp:
10/23/2013 02:36:30 AM (11 years ago)
Author:
r-a-y
Message:

Do not use wp_parse_id_list() twice in static group get() methods.

BP_Groups_Group::get_group_extras() already uses the wp_parse_id_list()
function to sanitize the group IDs.

No need to sanitize before the get_group_extras() method call.

File:
1 edited

Legend:

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

    r7460 r7461  
    523523        // Populate some extra information instead of querying each time in the loop
    524524        if ( !empty( $r['populate_extras'] ) ) {
    525             $group_ids = implode( ',', wp_parse_id_list( $group_ids ) );
    526525            $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, $r['type'] );
    527526        }
     
    706705
    707706        if ( !empty( $populate_extras ) ) {
    708             foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
    709             $group_ids = implode( ',', wp_parse_id_list( $group_ids ) );
     707            foreach ( (array) $paged_groups as $group ) {
     708                $group_ids[] = $group->id;
     709            }
    710710            $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
    711711        }
     
    747747
    748748        if ( !empty( $populate_extras ) ) {
    749             foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
    750             $group_ids = implode( ',', wp_parse_id_list( $group_ids ) );
     749            foreach ( (array) $paged_groups as $group ) {
     750                $group_ids[] = $group->id;
     751            }
    751752            $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
    752753        }
     
    790791                $group_ids[] = $group->id;
    791792            }
    792             $group_ids    = implode( ',', wp_parse_id_list( $group_ids ) );
    793793            $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
    794794        }
     
    829829
    830830        if ( !empty( $populate_extras ) ) {
    831             foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
    832             $group_ids = implode( ',', wp_parse_id_list( $group_ids ) );
     831            foreach ( (array) $paged_groups as $group ) {
     832                $group_ids[] = $group->id;
     833            }
    833834            $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
    834835        }
Note: See TracChangeset for help on using the changeset viewer.