Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Get user roles WordPress
rakeshr
Jul 25th, 2016
74
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
PHP
0.17 KB
| None
|
0
0
raw
download
clone
embed
print
report
global
$current_user
;
$current_user
->
caps
=
array_keys
(
$current_user
->
caps
)
;
$ncaps
=
count
(
$current_user
->
caps
)
;
$role
=
$current_user
->
caps
[
$ncaps
-
1
]
;
echo
$role
;
Add Comment
Please,
Sign In
to add comment
Public Pastes
Beta 1.7V1
Lua | 24 sec ago | 0.01 KB
Python summarizer
Python | 13 min ago | 1.01 KB
Untitled
HTML | 18 min ago | 2.39 KB
Untitled
C++ | 19 min ago | 2.04 KB
Untitled
C++ | 21 min ago | 0.36 KB
Untitled
Python | 22 min ago | 0.70 KB
Untitled
HTML | 23 min ago | 0.34 KB
lab13
C | 41 min ago | 2.18 KB
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!