最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

multisite - Removing "Sub-menus" from My Sites Drop-down in Admin Bar

programmeradmin0浏览0评论

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);
    }
}
发布评论

评论列表(0)

  1. 暂无评论