Skip to:
Content

BuddyPress.org

Changeset 5971


Ignore:
Timestamp:
04/09/2012 09:45:56 PM (8 years ago)
Author:
boonebgorges
Message:

Reconfigure the way that the default group extension gets communicated to BP_Groups_Component::setup_nav().
By ensuring that the top-level single-group navigation item has its default_subnav_slug set dynamically to the correct default_extension, we ensure that the Home (Activity) tab remains accessible even when it is not the default.
Fixes #4072

File:
1 edited

Legend:

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

    r5927 r5971  
    1616
    1717class BP_Groups_Component extends BP_Component {
     18    /**
     19     * Default group extension
     20     *
     21     * @since BuddyPress (1.6)
     22     */
     23    var $default_component;
    1824
    1925    /**
     
    177183            }
    178184           
    179             $groups_default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' );
    180            
     185            $this->default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' );
     186
    181187            if ( !bp_current_action() ) {
    182                 $bp->current_action = $groups_default_extension;
    183             } else if ( bp_is_current_action( $groups_default_extension ) && !empty( $bp->action_variables ) )  {
     188                $bp->current_action = $this->default_extension;
     189            } else if ( bp_is_current_action( $this->default_extension ) && !empty( $bp->action_variables ) )  {
    184190                unset( $bp->canonical_stack['action'] );
    185191            }
     
    323329                'position'            => -1, // Do not show in BuddyBar
    324330                'screen_function'     => 'groups_screen_group_home',
    325                 'default_subnav_slug' => 'home',
     331                'default_subnav_slug' => $this->default_extension,
    326332                'item_css_id'         => $this->id
    327333            );
Note: See TracChangeset for help on using the changeset viewer.