rakeshr

Get user roles WordPress

Jul 25th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.17 KB | None | 0 0
  1. global $current_user;
  2. $current_user->caps = array_keys($current_user->caps);
  3. $ncaps = count($current_user->caps);
  4. $role = $current_user->caps[$ncaps - 1];
  5. echo $role;
Add Comment
Please, Sign In to add comment