#491 closed enhancement (no action required)
Add a visibility callback to bp_core_add_nav_default
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | trivial | |
Severity: | Version: | ||
Component: | Keywords: | ||
Cc: | JurMous |
Description
Take as an example the flickr plugin.
When the user has no flickr account this icon in the menu is useless for the user... It should only be visible if the user has set some settings on it.
Why not depend the visibility on if the user has set some settings?
Proposition: add a callback option on the bp_core_add_nav_default function to check if it is to be shown. The component dev could then add a callback which checks the settings. (or if the user has access, or is admin)
This can make the profiles much cleaner in the long run.
For example:
bp_core_add_nav_default( $parent_id, $function [, $slug, $visibility_callback ]
And add $user_has_access, $admin_only to the callback as options in an example.
Maybe even add this to core 1.0 so plugin devvers can take this in early? Otherwise keep it 1.1 if accepted.
Hmm, you can wrap the function in an if clause to get the same result.