Created
April 29, 2013 06:27
-
-
Save facelordgists/5479994 to your computer and use it in GitHub Desktop.
WORDPRESS: return true if viewing as admin
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
/* Return true if user viewing site with admin user level | |
function viewing_as_admin(){ | |
get_currentuserinfo(); | |
global $user_level; | |
if ($user_level < 10) { | |
return false; | |
} else { | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment