Skip to content

Instantly share code, notes, and snippets.

@leowebguy
Created November 19, 2015 21:06
Show Gist options
  • Save leowebguy/6663320676ad528c24eb to your computer and use it in GitHub Desktop.
Save leowebguy/6663320676ad528c24eb to your computer and use it in GitHub Desktop.
Check WordPress user and add Admin Styles
<?php
global $current_user;
get_currentuserinfo();
function inject_admin_styles() {
echo '<style type="text/css">#menu-posts {display:none;} </style>';
}
if ($current_user->user_login !== 'admin') { //replace this with your admin user
add_action('admin_print_styles', 'inject_admin_styles', 11 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment