How can I remove “edit your profile” submenu under “my-account-with-avatar” admin menu bar, while still keeping the avatar and logout?
3 s
There is a remove_menu
hook for the admin menu bar.
The class you want to hook into $wp_admin_bar
, you can see the remove function here and test it out since there is no documentation on it ( line 86), it should work with the submenu ID.
http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/class-wp-admin-bar.php
Since you did not seem to believe me here is the code………
function ya_do_it_admin_bar_remove() {
global $wp_admin_bar;
/* **edit-profile is the ID** */
$wp_admin_bar->remove_menu('edit-profile');
}
add_action('wp_before_admin_bar_render', 'ya_do_it_admin_bar_remove', 0);