Could class AppearancePermissions hide just the customizer from admin bar?
-
We use both your excellent plugin as well as the modification for allowing menus and widgets.
In the provided code you use the
public function hide_admin_bar
and as result you hide the whole of the front end Toolbar. Also, although it removes the Toolbar but leaves a void stripe on top.public function hide_admin_bar() { global $current_user; if ($this->user_has_allowed_role($current_user)) { // block front end admin menu bar show_admin_bar(false); } }
We need to keep the admin bar but only have the Customizer removed.
We tried to implement the following code from the codex into your code without success.function wpdocs_remove_customize( $wp_admin_bar ) { // Remove customize, background and header from the menu bar. $wp_admin_bar->remove_node( 'customize' ); $wp_admin_bar->remove_node( 'customize-background' ); $wp_admin_bar->remove_node( 'customize-header' ); } add_action( 'admin_bar_menu', 'wpdocs_remove_customize', 999 );
Can you please help on how to include it?
PS: In general I believe that to remove all of the Toolbar is too much. When we do, it confuses users that have (under their profile) “Show Toolbar when viewing site” checked.
- The topic ‘Could class AppearancePermissions hide just the customizer from admin bar?’ is closed to new replies.