Ticket #5411: 5411.02b.patch
| File 5411.02b.patch, 3.5 KB (added by , 12 years ago) |
|---|
-
bp-groups/bp-groups-classes.php
class BP_Groups_Group { 161 161 */ 162 162 public function __construct( $id = null, $args = array() ) { 163 163 $this->args = wp_parse_args( $args, array( 164 'populate_extras' => true,164 'populate_extras' => false, 165 165 ) ); 166 166 167 167 if ( !empty( $id ) ) { -
bp-groups/bp-groups-functions.php
function groups_get_group( $args = '' ) { 43 43 $r = wp_parse_args( $args, array( 44 44 'group_id' => false, 45 45 'load_users' => false, 46 'populate_extras' => true,46 'populate_extras' => false, 47 47 ) ); 48 48 49 49 $group_args = array( -
bp-groups/bp-groups-loader.php
class BP_Groups_Component extends BP_Component { 162 162 163 163 $bp->is_single_item = true; 164 164 $current_group_class = apply_filters( 'bp_groups_current_group_class', 'BP_Groups_Group' ); 165 $this->current_group = apply_filters( 'bp_groups_current_group_object', new $current_group_class( $group_id ) ); 165 166 if ( $current_group_class == 'BP_Groups_Group' ) { 167 $this->current_group = groups_get_group( array( 168 'group_id' => $group_id, 169 'populate_extras' => true, 170 ) ); 171 172 } else { 173 $this->current_group = apply_filters( 'bp_groups_current_group_object', new $current_group_class( $group_id ) ); 174 } 166 175 167 176 // When in a single group, the first action is bumped down one because of the 168 177 // group name, so we need to adjust this and set the group name to current_item. -
bp-groups/bp-groups-template.php
class BP_Groups_Template { 160 160 $this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude ); 161 161 } else if ( 'single-group' == $type ) { 162 162 $group = new stdClass; 163 $group->group_id = BP_Groups_Group::get_id_from_slug( $slug);163 $group->group_id = bp_get_current_group_id(); 164 164 $this->groups = array( $group ); 165 165 } else { 166 166 $this->groups = groups_get_groups( array( … … class BP_Groups_Template { 261 261 $this->group = $this->next_group(); 262 262 263 263 if ( $this->single_group ) 264 $this->group = groups_get_ group( array( 'group_id' => $this->group->group_id ));264 $this->group = groups_get_current_group(); 265 265 266 266 if ( 0 == $this->current_group ) // loop has just started 267 267 do_action('group_loop_start'); -
tests/testcases/groups/functions.php
Bar!'; 562 562 $old_user = get_current_user_id(); 563 563 $this->set_current_user( $u1 ); 564 564 565 $group1 = groups_get_group( array( 'group_id' => $g, ) );565 $group1 = groups_get_group( array( 'group_id' => $g, 'populate_extras' => true ) ); 566 566 567 567 $this->set_current_user( $u2 ); 568 568 569 $group2 = groups_get_group( array( 'group_id' => $g, ) );569 $group2 = groups_get_group( array( 'group_id' => $g, 'populate_extras' => true ) ); 570 570 571 571 $this->assertNotEquals( $group1, $group2 ); 572 572