Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/21/2011 01:03:41 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Switch individual group navigation to use current_item as slug instead of root_component, to avoid collisions in bp_options_nav resulting in single groups not being visible if the group->slug is the same as the group->root_slug. Adjust the bp_core_new_nav_item() and bp_core_new_subnav_item() functions to look for new current_item option. Should be backwards compatible with existing group extensions, but will need testing.

File:
1 edited

Legend:

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

    r3982 r4057  
    232232                if ( bp_is_groups_component() && bp_is_single_item() ) {
    233233
     234                        unset( $main_nav ); unset( $sub_nav );
     235
    234236                        // Add 'Groups' to the main navigation
    235237                        $main_nav = array(
    236238                                'name'                => __( 'Groups', 'buddypress' ),
    237                                 'slug'                => $this->root_slug,
     239                                'slug'                => $this->current_group->slug,
    238240                                'position'            => -1, // Do not show in BuddyBar
    239241                                'screen_function'     => 'groups_screen_group_home',
     
    249251                                'slug'            => 'home',
    250252                                'parent_url'      => $group_link,
    251                                 'parent_slug'     => $this->root_slug,
     253                                'parent_slug'     => $this->current_group->slug,
    252254                                'screen_function' => 'groups_screen_group_home',
    253255                                'position'        => 10,
     
    261263                                        'slug'            => 'admin',
    262264                                        'parent_url'      => $group_link,
    263                                         'parent_slug'     => $this->root_slug,
     265                                        'parent_slug'     => $this->current_group->slug,
    264266                                        'screen_function' => 'groups_screen_group_admin',
    265267                                        'position'        => 20,
     
    280282                                        'slug'               => 'request-membership',
    281283                                        'parent_url'         => $group_link,
    282                                         'parent_slug'        => $this->root_slug,
     284                                        'parent_slug'        => $this->current_group->slug,
    283285                                        'screen_function'    => 'groups_screen_group_request_membership',
    284286                                        'position'           => 30
     
    292294                                        'slug'            => 'forum',
    293295                                        'parent_url'      => $group_link,
    294                                         'parent_slug'     => $this->root_slug,
     296                                        'parent_slug'     => $this->current_group->slug,
    295297                                        'screen_function' => 'groups_screen_group_forum',
    296298                                        'position'        => 40,
     
    304306                                'slug'            => 'members',
    305307                                'parent_url'      => $group_link,
    306                                 'parent_slug'     => $this->root_slug,
     308                                'parent_slug'     => $this->current_group->slug,
    307309                                'screen_function' => 'groups_screen_group_members',
    308310                                'position'        => 60,
     
    317319                                                'slug'            => 'send-invites',
    318320                                                'parent_url'      => $group_link,
    319                                                 'parent_slug'     => $this->root_slug,
     321                                                'parent_slug'     => $this->current_group->slug,
    320322                                                'screen_function' => 'groups_screen_group_invite',
    321323                                                'item_css_id'     => 'invite',
Note: See TracChangeset for help on using the changeset viewer.