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

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

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);
    }
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744758458a4592024.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信