Reply To: Deleting Admin Sub-menu items
hi @adenicol,
you’re using the old buddybar or an old BP version, right ? Here is a solution to remove items in BP 1.5 > 1.6.x with buddybar activated, but be aware that some menus changed place in the upcoming BP 1.7
So if you mean the WP Toolbar (like here the black one on top) witch holds the group admin options, the code sit in bp-groups/bp-groups-buddybar.php
This contains only one function. Simply copy it to your (preferably child) theme functions.php, rename it, do your changes (html remove, ad/remove conditinals), deactivate the original filter and register.
original function is bp_groups_adminbar_admin_menu()
rename it to my_bp_groups_adminbar_admin_menu() (or what you want)
and do the same in the action filter.
original: add_action( ‘bp_adminbar_menus’, ‘bp_groups_adminbar_admin_menu’, 20 );
modified: add_action( ‘bp_adminbar_menus’, ‘my_bp_groups_adminbar_admin_menu’, 20 );
Resume
remove_action( ‘bp_adminbar_menus’, ‘bp_groups_adminbar_admin_menu’, 20 );
function my_bp_groups_adminbar_admin_menu() {
bla bla
}
add_action( ‘bp_adminbar_menus’, ‘my_bp_groups_adminbar_admin_menu’, 20 );