Skip to:
Content

BuddyPress.org

Changes between Initial Version and Version 1 of Ticket #6301


Ignore:
Timestamp:
03/18/2015 05:00:05 PM (9 years ago)
Author:
dcavins
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6301 – Description

    initial v1  
    11In our new group extension access settings (see r8605), we've allowed users to independently set who can see the extension's navigation tab and who can visit the extension's display pane. However, because of a limitation in `bp_core_new_subnav_item()`, if who can visit the tab is more permissive than who can see the tab (for example, you create an extension that doesn't need a navigation tab, but does need to display the contents to anyone, like `'show_tab' => 'noone', 'access' => 'anyone'`) `bp_core_subnav_item()` is never called. This prevents the navigation link from being created, but  it turns out that `bp_core_subnav_item()` must be called in order for the screen function to be caught. (See `bp_core_maybe_hook_new_subnav_screen_function()` in `bp-core-buddybar.php`.) And there's no way currently to call `bp_core_subnav_item()` without actually creating the navigation link.
    22
    3 I've attached a patch (xx.01) that adds another argument, `user_can_see_nav_item`,  to `bp_core_new_subnav_item()` that controls whether the link is created in `bp_get_options_nav()`. `user_has_access` is still used to determine whether the screen function should be hooked or not.
     3I've attached a patch (6301.01) that adds another argument, `user_can_see_nav_item`,  to `bp_core_new_subnav_item()` that controls whether the link is created in `bp_get_options_nav()`. `user_has_access` is still used to determine whether the screen function should be hooked or not.
    44
    5 In patch xx.02, I used the new argument to call `bp_core_new_subnav_item()` if the user can see the nav tab or access the extension's display pane.
     5In patch 6301.02, I used the new argument to call `bp_core_new_subnav_item()` if the user can see the nav tab or access the extension's display pane.
    66
    77I'm unfamiliar with the navigation creation functions, so would appreciate feedback.