Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to Remove and Add Items in “bp_get_displayed_user_nav”


PapaTango
Member

@blogmudgeon

Sorry to say, a lot of us on the end publishing equation are not programmers… I used EngineSite to find the string, but have no clue as to where the parent ID for the menu item is to be found. even then, is it simply a matter of entering that ID into the argument?

‘/**
* bp_core_remove_nav_item()
*
* Removes a navigation item from the sub navigation array used in BuddyPress themes.
*
* @package BuddyPress Core
* @param $parent_id The id of the parent navigation item.
* @param $slug The slug of the sub navigation item.
*/
function bp_core_remove_nav_item( $parent_id ) {
global $bp;

/* Unset subnav items for this nav item */
if ( is_array( $bp->bp_options_nav[$parent_id] ) ) {
foreach( (array)$bp->bp_options_nav[$parent_id] as $subnav_item ) {
bp_core_remove_subnav_item( $parent_id, $subnav_item );
}
}

unset( $bp->bp_nav[$parent_id] );’

Thanks!

P

Skip to toolbar