The admin bar is now called the “Toolbar”, combining the Admin Bar and admin header. You cannot turn off the Toolbar on the backend anymore, however you CAN turn it off on the front end in your profile.
To turn it off globally (for all users) on the front end you can put this in your theme’s functions.php:
if(!is_admin()){
add_filter('show_admin_bar', '__return_false');
}
or
show_admin_bar( false );
I’ve also noticed it covers up the first lines of notices and errors.
You can turn it off in the backend.
this worked for me.
if (!function_exists('disableAdminBar')) {
function disableAdminBar() { // begin disableAdminBar function
remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
function remove_admin_bar_style_backend() {
echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>';
}
add_filter('admin_head','remove_admin_bar_style_backend');
}
}
add_action('init','disableAdminBar');
I know it’s not the best way of doing it, but when your developing themes and plugins you need to be able to see those errors. So the toolbar has to go (for developing anyway). I don’t recommend doing something like that for a live site.
I don’t think they thought about that when the core team designed this new toolbar.
Can yes, should no.
And yes, the core team thought about that. They do this instead: http://nacin.com/tag/wp_debug/
And yes, the core team thought about that. They do this instead: http://nacin.com/tag/wp_debug/
Which part are you referring to? I didn’t see anything that would solve the toolbar covering the errors issue.
They use other methods to track errors (like logging them etc).
This seems to work.
if ((error_reporting() && is_admin())) {
echo '<style>body{ padding-top: 28px !important; }</style>';
return;
}
If there is an error it adds padding to the body pushing everything down except the tool bar.