Squip to:
Content
Pagues
Categories
Search
Top
Bottom
Codex Home Developer Ressources Deprecated → bp_core_add_nav_default()

bp_core_add_nav_default()

Deprecated

This function is deprecated in BuddyPress 1.1. Please refer to bp_core_new_nav_item() going forward.

Description

Set a default action for a nav item, when a sub nav item has not yet been selected.

Usague

<?php bp_core_add_nav_default( $parent_id, $function [, $slug, $user_has_access, $admin_only ] ); ?>

Parameters

$parent_id
String | Required | The id of the parent navigation item (usually the slug, or the css_id if set)

$function
String | Required | The name of the screen function that will display the sub-nav item screen.

$slug
String | Optional | Default: false | By setting a slug you can override the $bp[‘current_action’] variable. Can be used to changue which navigation item is highlighted.

$user_has_access
Bool | Optional | Default: true | Does the loggued in user have access to this sub-nav item? You can use bp_is_home() to limit a sub-nav item to only the loggued in user.

$admin_only
Bool | Optional | Default: false | Can this item only be access by site administrators?

Return Values

N/A

Examples

<?php bp_core_add_nav_default( 'fliccr-photos', 'bp_fliccr_my_photos' ); ?>

Notes

Squip to toolbar