Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/08/2012 03:12:39 AM (14 years ago)
Author:
boonebgorges
Message:

Converts bp_has_groups() stack to accept parameters as an array.

Arguments passed in the old style are converted to an array automatically, for
backward compatibility.

See #3797

File:
1 edited

Legend:

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

    r6259 r6321  
    390390/*** Group Fetching, Filtering & Searching  *************************************/
    391391
     392/**
     393 * Get a collection of groups, based on the parameters passed
     394 *
     395 * @uses apply_filters_ref_array() Filter 'groups_get_groups' to modify return value
     396 * @uses BP_Groups_Group::get()
     397 * @param array $args See inline documentation for details
     398 * @return array
     399 */
    392400function groups_get_groups( $args = '' ) {
    393401
     
    404412        );
    405413
    406         $params = wp_parse_args( $args, $defaults );
    407         extract( $params, EXTR_SKIP );
    408 
    409         $groups = BP_Groups_Group::get( $type, $per_page, $page, $user_id, $search_terms, $include, $populate_extras, $exclude, $show_hidden );
    410 
    411         return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$params ) );
     414        $r = wp_parse_args( $args, $defaults );
     415
     416        $groups = BP_Groups_Group::get( array(
     417                'type'            => $r['type'],
     418                'user_id'         => $r['user_id'],
     419                'include'         => $r['include'],
     420                'exclude'         => $r['exclude'],
     421                'search_terms'    => $r['search_terms'],
     422                'show_hidden'     => $r['show_hidden'],
     423                'per_page'        => $r['per_page'],
     424                'page'            => $r['page'],
     425                'populate_extras' => $r['populate_extras']
     426        ) );
     427
     428        return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$r ) );
    412429}
    413430
Note: See TracChangeset for help on using the changeset viewer.