Skip to:
Content

BuddyPress.org

Ticket #6301: 6301.02.patch

File 6301.02.patch, 1.6 KB (added by dcavins, 10 years ago)

Use the 'user_can_see_nav_item' argument to call bp_core_new_subnav_item() if the user can see the nav tab or access the extension's display pane.

  • src/bp-groups/bp-groups-classes.php

    diff --git src/bp-groups/bp-groups-classes.php src/bp-groups/bp-groups-classes.php
    index c91c867..7d9fb75 100644
    class BP_Group_Extension { 
    35763576                }
    35773577
    35783578                $user_can_see_nav_item = $this->user_can_see_nav_item();
     3579                $user_can_visit = $this->user_can_visit();
    35793580
    3580                 if ( $user_can_see_nav_item ) {
     3581                if ( $user_can_see_nav_item || $user_can_visit ) {
    35813582                        $group_permalink = bp_get_group_permalink( groups_get_current_group() );
    35823583
    35833584                        bp_core_new_subnav_item( array(
    3584                                 'name'            => ! $this->nav_item_name ? $this->name : $this->nav_item_name,
    3585                                 'slug'            => $this->slug,
    3586                                 'parent_slug'     => bp_get_current_group_slug(),
    3587                                 'parent_url'      => $group_permalink,
    3588                                 'position'        => $this->nav_item_position,
    3589                                 'item_css_id'     => 'nav-' . $this->slug,
    3590                                 'screen_function' => array( &$this, '_display_hook' ),
    3591                                 'user_has_access' => $user_can_see_nav_item,
    3592                                 'no_access_url'   => $group_permalink,
     3585                                'name'                          => ! $this->nav_item_name ? $this->name : $this->nav_item_name,
     3586                                'slug'                          => $this->slug,
     3587                                'parent_slug'                   => bp_get_current_group_slug(),
     3588                                'parent_url'                    => $group_permalink,
     3589                                'position'                      => $this->nav_item_position,
     3590                                'item_css_id'                   => 'nav-' . $this->slug,
     3591                                'screen_function'               => array( &$this, '_display_hook' ),
     3592                                'user_has_access'               => $user_can_visit,
     3593                                'user_can_see_nav_item' => $user_can_see_nav_item,
     3594                                'no_access_url'                 => $group_permalink,
    35933595                        ) );
    35943596
    35953597                        // When we are viewing the extension display page, set the title and options title