SHARE
TWEET

get current user role

a guest Mar 22nd, 2016 262 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     if(is_user_logged_in()) :
  3.         $user_role = $current_user->roles;
  4.         echo $user_role[0];                
  5.     endif;
  6. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top