Search Results for 'bp_core_remove_nav_item'
-
AuthorSearch Results
-
November 27, 2009 at 11:58 am #57583
In reply to: Deleting a certain part of the navigation
Anass RhamarParticipantHi,
Tim was 99% right – you just need to hook it into “plugins_loaded”. That’s it. This one works for me:
function remove_navitems()
{
bp_core_remove_nav_item('blogs');
}
add_action('plugins_loaded', 'remove_navitems');Cheers
November 12, 2009 at 1:54 pm #56543In reply to: Editing Navigation
Anonymous User 96400InactiveThis 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.
June 15, 2009 at 3:58 am #47489In reply to: Deleting a certain part of the navigation
3125432InactiveHi –
I wanted to do something similar – remove ‘Edit Profile’ from the MY PROFILE nav section.
I tried using this code in bp-custom.php:
function remove_navitems()
{
bp_core_remove_nav_item(‘profile_edit’);
}
add_action(‘bp_core_setup_nav’, ‘remove_navitems’);
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.
Thanks,
Brian
May 14, 2009 at 6:19 pm #45351In reply to: Deleting a certain part of the navigation
Tim MooreParticipantI 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:
function remove_navitems()
{
bp_core_remove_nav_item('blogs');
}
add_action('bp_core_setup_nav', 'remove_navitems');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.
May 14, 2009 at 2:38 pm #45334In reply to: Deleting a certain part of the navigation
Tim MooreParticipantThere’s also a function you could probably use via a hook:
bp_core_remove_nav_item($name)
Replace $name with the name of the nav item you want removed.
-
AuthorSearch Results