Hi,
bp’s Usermenu is added to wp_admin_menu on the Toolbar, under Howdy. This BP menu ID is “my-account”.
When you’re on a profile page, you see also these items in the Buddymenu, below the profile header cover.
Some working examples here:
Remove an item from Usermenu
Remove an item from Buddymenu
Since 2.6, BuddyPress use a navigation API. See here for many use case.
Read also WP codex about admin bar menus.
Where to put BuddyPress custom code ?
Usually into bp-custom.php. This file is to BP code what a child theme is to a theme: a safe place with high priority where nothing get to loose when an update occurs !
Child’s functions.php should be reserved to whatever you need for the theme itself.
That said, it can happen(rarely) that some custom code won’t work from within bp-custom. In this case, feel free to remove it from bp-custom and give it a try inside child’s functions.php.
As novice, you’re invited to read BP and WP codex if you want to customize.
Thank you, very much for your response! This was very helpful. I will study up and try again…
I placed the following code in the bp-custom.php which was found under the wp-content -> plugins.
function bpfr_hide_tabs() {
global $bp;
if ( bp_is_user() && !is_super_admin() ) {
bp_core_remove_nav_item( 'notifications', 'activity', 'groups', 'messages', 'forums', 'settings');
}
}
add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );
It breaks my site, shuts it down. From what I’ve read, I am supposed to specify what tab is open when opening a profile. Otherwise, browsers don’t know what to display since default is “Activity” and I’m removing it… Can someone please tell me where I went wrong? I appreciate the help!
I also attempted to add them individually…
function bpfr_hide_tabs() {
global $bp;
if ( bp_is_user() && !is_super_admin() ) {
bp_core_remove_nav_item( 'activity' );
bp_core_remove_nav_item( 'notifications' );
bp_core_remove_nav_item( 'messages' );
bp_core_remove_nav_item( 'groups' );
bp_core_remove_nav_item( 'forums' );
bp_core_remove_nav_item( 'settings' );
}
}
add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );
I’ve noticed some changes require us to repeat ourselves, while others allow us to list changes within one line of code. Haven’t deciphered this anomaly just yet.
My brilliant husband is my coder… He figured out how to define the default component, and saved the day. I hope this helps others.
define( 'BP_DEFAULT_COMPONENT', 'profile' );
function bpfr_hide_tabs() {
global $bp;
if ( bp_is_user() && !is_super_admin() ) {
bp_core_remove_nav_item( 'activity');
bp_core_remove_nav_item( 'notifications');
bp_core_remove_nav_item( 'messages' );
bp_core_remove_nav_item( 'forums' );
bp_core_remove_nav_item( 'groups' );
bp_core_remove_nav_item( 'settings' );
}
}
add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );