Skip to:
Content

BuddyPress.org

Ticket #3312: bp-groups.patch

File bp-groups.patch, 1.6 KB (added by ddean, 11 years ago)

groups filter proposal - function-based

  • trunk/bp-groups/bp-groups-functions.php

     
    3030        $args = wp_parse_args( $args, $defaults );
    3131        extract( $args, EXTR_SKIP );
    3232
    33         return apply_filters( 'groups_get_group', new BP_Groups_Group( $group_id, true, $load_users ) );
     33        $group_class = apply_filters( 'groups_get_group_class', 'BP_Groups_Group' );
     34        return apply_filters( 'groups_get_group', new $group_class( $group_id, true, $load_users ) );
    3435}
    3536
    3637/*** Group Creation, Editing & Deletion *****************************************/
  • trunk/bp-groups/bp-groups-loader.php

     
    9191                /** Single Group Globals **********************************************/
    9292
    9393                // Are we viewing a single group?
    94                 if ( bp_is_groups_component() && $group_id = BP_Groups_Group::group_exists( bp_current_action() ) ) {
     94                if ( bp_is_groups_component() && $group_id = groups_check_group_exists( bp_current_action() ) ) {
    9595
    9696                        $bp->is_single_item  = true;
    97                         $this->current_group = new BP_Groups_Group( $group_id );
     97                    $this->current_group = groups_get_group( $group_id );
    9898
    9999                        // When in a single group, the first action is bumped down one because of the
    100100                        // group name, so we need to adjust this and set the group name to current_item.