Created
August 21, 2012 04:05
-
-
Save claudiosanches/3411403 to your computer and use it in GitHub Desktop.
Current user is...
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
<?php | |
$current_user = wp_get_current_user(); | |
if (isset($current_user->caps['administrator'])) { | |
echo 'Olá administrador'; | |
} | |
if (isset($current_user->caps['editor'])) { | |
echo 'Olá editor'; | |
} | |
if (isset($current_user->caps['author'])) { | |
echo 'Olá autor'; | |
} | |
if (isset($current_user->caps['contributor'])) { | |
echo 'Olá colaborador'; | |
} | |
if (isset($current_user->caps['subscriber'])) { | |
echo 'Olá assinante'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment