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
1 Answer
Reset to default 0Old 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
版权声明:本文标题:multisite - Removing "Sub-menus" from My Sites Drop-down in Admin Bar 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744758458a2623605.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论