Skip to content

Instantly share code, notes, and snippets.

@mustardBees
Created November 7, 2012 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustardBees/4030980 to your computer and use it in GitHub Desktop.
Save mustardBees/4030980 to your computer and use it in GitHub Desktop.
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 http://goo.gl/P5FTK
*/
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