admin管理员组

文章数量:1391964

How does one remove the "sub-menu" that appears to the right of each site listed in the My Sites drop down from the admin bar?

That is, I want to have a list of My Sites without the Dashboard/New Post/Manage Comments/Visit Site links appearing to the right of the arrow for each site in the My Sites drop down list.

This would simplify the user interface significantly for my users.

Any guidance would be greatly appreciated. Thank you.

How does one remove the "sub-menu" that appears to the right of each site listed in the My Sites drop down from the admin bar?

That is, I want to have a list of My Sites without the Dashboard/New Post/Manage Comments/Visit Site links appearing to the right of the arrow for each site in the My Sites drop down list.

This would simplify the user interface significantly for my users.

Any guidance would be greatly appreciated. Thank you.

Share Improve this question asked Feb 2, 2014 at 4:13 user46025user46025 211 bronze badge 1
  • Please do share, what have you tried yet to accomplish this and the relevant codes. – Maruti Mohanty Commented Feb 2, 2014 at 6:57
Add a comment  | 

1 Answer 1

Reset to default 0

Old question but I just came accros a fix.

I hope it helps someone else.

Add this to your theme functions.php file

add_action( 'wp_before_admin_bar_render', 'remove_mysites_comment_link' );
function remove_mysites_comment_link () {
    global $wp_admin_bar;
    foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
        $menu_id_c = 'blog-' . $blog->userblog_id . '-c';
        $wp_admin_bar->remove_menu($menu_id_c);
    }
}

本文标签: multisiteRemoving quotSubmenusquot from My Sites Dropdown in Admin Bar