Search Results for 'bp_core_remove_nav_item'
Don’t dig around in the array, use
bp_core_remove_nav_item() and bp_core_remove_subnav_item()Anass RhamarParticipant
Tim was 99% right – you just need to hook it into “plugins_loaded”. That’s it. This one works for me:
This is being handled with functions like these:
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:
$link = '<li><a href="'. $bp->loggedin_user->domain . 'my-page" title="'. __( 'My Page') .'">'. __( 'My Page') .'</a></li>';
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.AnonymousInactive
I wanted to do something similar – remove ‘Edit Profile’ from the MY PROFILE nav section.
I tried using this code in bp-custom.php:
That didn’t work.
As you can see, I was just totally guessing as to the exact name of the nav item. I have no idea where to find it, or what file to examine to find the correct nav item to reference. Any help or suggestion would be greatly appreciated.
I believe you can put it in /plugins/bp-custom.php (create the file if it doesn’t exist already). This is rough code, but I’m assuming you’ll want to do it like this:
At a first glance, that is what I’d try. Not sure if it’ll work, but that should get you going in the right direction.Tim MooreParticipant
There’s also a function you could probably use via a hook:
Replace $name with the name of the nav item you want removed.