WordPress顶部管理工具条(admin_bar)显示 (草稿)

相关类:
WP_Admin_Bar

Class: Core class used to implement the Toolbar API.
核心类:用于执行工具栏API

global $wp_admin_bar;
WP_Admin_Bar::add_menu

add_action( ‘admin_bar_menu’, ‘modify_admin_bar’ );
function modify_admin_bar( $wp_admin_bar ){
// do something with $wp_admin_bar;
}
参考:
10+关于WORDPRESS顶部工具栏(ADMINBAR)的小技巧
25+自定义WordPress顶部管理工具条的技巧
show_admin_bar(false);
wordpress:玩转Admin Bar
在 WordPress 顶部管理工具条显示登录表单
How to Disable WordPress Admin Bar for All Users Except Administrators
相关插件:
wordpress除去顶部烦人的工具条(admin bar)
两种无插件实现移除WordPress顶部管理工具栏(Admin Bar)方法
WordPress 将工具栏移到底部
25+自定义WordPress顶部管理工具条的技巧
Disable Admin Bar for All Users Except for Administrators
关闭,所有用户 除了管理员。
Paste this code in your theme’s functions.php file or your site-specific plugin.
add_action(‘after_setup_theme’, ‘remove_admin_bar’);
function remove_admin_bar() {
if (!current_user_can(‘administrator’) && !is_admin()) {
  show_admin_bar(false);
}
}
Disable Admin Bar for All Users
If you want to disable it for all users, then simply put use this code in your theme’s functions.php file or your site-specific plugin.
/* Disable WordPress Admin Bar for all users but admins. */
  show_admin_bar(false);
相关插件:
Admin Bar Login 插件
对所有用户和访客隐藏工具条
只对管理员显示工具条
只在后台隐藏工具条
只在前台隐藏工具条
设置为:

Leave a Reply

Your email address will not be published. Required fields are marked *