Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/07/2010 11:17:17 AM (15 years ago)
Author:
boonebgorges
Message:

Reapplies changes to BP_Groups_Group::get methods that were accidentally reverted in r3300. Adds exclude parameters to groups get methods. Fixes #2639

File:
1 edited

Legend:

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

    r3365 r3371  
    2323    var $order;
    2424
    25     function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $include, $populate_extras ) {
     25    function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $include, $populate_extras, $exclude ) {
    2626        global $bp;
    2727
     
    3030
    3131        if ( 'invites' == $type ) {
    32             $this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page );
     32            $this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude );
    3333        } else if ( 'single-group' == $type ) {
    3434            $group = new stdClass;
     
    3636            $this->groups    = array( $group );
    3737        } else {
    38             $this->groups = groups_get_groups( array( 'type' => $type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'search_terms' => $search_terms, 'include' => $include, 'populate_extras' => $populate_extras ) );
     38            $this->groups = groups_get_groups( array( 'type' => $type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'search_terms' => $search_terms, 'include' => $include, 'exclude' => $exclude, 'populate_extras' => $populate_extras ) );
    3939        }
    4040
     
    173173        'search_terms' => $search_terms, // Pass search terms to return only matching groups
    174174        'include' => false, // Pass comma separated list of group ID's to return only these groups
     175        'exclude' => false, // Pass comma separated list of group ID's to exclude these groups
    175176
    176177        'populate_extras' => true // Get extra meta - is_member, is_banned
     
    180181    extract( $r );
    181182
    182     $groups_template = new BP_Groups_Template( (int)$user_id, $type, (int)$page, (int)$per_page, (int)$max, $slug, $search_terms, $include, (bool)$populate_extras );
     183    $groups_template = new BP_Groups_Template( (int)$user_id, $type, (int)$page, (int)$per_page, (int)$max, $slug, $search_terms, $include, (bool)$populate_extras, $exclude );
    183184    return apply_filters( 'bp_has_groups', $groups_template->has_groups(), &$groups_template );
    184185}
Note: See TracChangeset for help on using the changeset viewer.