Created
November 19, 2015 21:06
-
-
Save leowebguy/6663320676ad528c24eb to your computer and use it in GitHub Desktop.
Check WordPress user and add Admin Styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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