Skip to:
Content

BuddyPress.org

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#491 closed enhancement (no action required)

Add a visibility callback to bp_core_add_nav_default

Reported by: jurmous's profile JurMous 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.

Change History (3)

#1 @JurMous
16 years ago

  • Cc JurMous added

#2 @JurMous
16 years ago

  • Priority changed from major to trivial
  • Resolution set to invalid
  • Status changed from new to closed

Hmm, you can wrap the function in an if clause to get the same result.

#3 @JurMous
16 years ago

  • Milestone Core 1.1 deleted
Note: See TracTickets for help on using tickets.