Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Prevent WordPress Admin Toolbar from being hidden via the user profile edit screen
* Prevent Toolbar from being hidden
* Hide the "Show Toolbar when viewing site" option on the profile page editor.
* @author: Don Fischer
* @link
function iweb_hide_admin_bar_profile_option() {
echo '<style type="text/css">.show-admin-bar { display: none !important; }</style>';
add_action( 'admin_print_styles-profile.php', 'iweb_hide_admin_bar_profile_option' );
add_action( 'admin_print_styles-user-edit.php', 'iweb_hide_admin_bar_profile_option' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.