Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Editing Navigation


Boris
Participant

@travel-junkie

This is being handled with functions like these:

bp_core_new_nav_item

bp_core_new_subnav_item

bp_core_remove_nav_item

bp_core_remove_subnav_item

All of these functions (and a lot more) can be found in buddypress/bp-core.php. They are well documented and you can always have a look at the various core component how they use these functions.

To the admin bar you can add links like so:

function sv_add_link()
{
global $bp;

$link = '<li><a href="'. $bp->loggedin_user->domain . 'my-page" title="'. __( 'My Page') .'">'. __( 'My Page') .'</a></li>';
echo $link;
}
}
add_action( 'bp_adminbar_menus', 'sv_add_link' );

Removing links also works with actions. Using the example from above you’d have to put this into your functions.php file:

remove_action( 'bp_adminbar_menus', 'sv_add_link' )

You have to remove an action at the same priority as it has been added, so if you find an add_action call like this:

add_action( 'bp_adminbar_menus', 'sv_add_link' , 7 );

you’d have to remove it with this:

remove_action( 'bp_adminbar_menus', 'sv_add_link' , 7 );

Otherwise it won’t work.

Hope this helps you along a bit.

Skip to toolbar