Created
April 17, 2015 14:21
-
-
Save jdhobbsuk/86b4aae49d4ea4ecad4e to your computer and use it in GitHub Desktop.
WordPress Get current user's role
This file contains hidden or 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
| function get_current_user_role(){ | |
| if( is_user_logged_in() ): | |
| global $current_user; | |
| $user_role = $current_user->roles[0]; | |
| return $user_role; | |
| else: | |
| return FALSE; | |
| endif; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment