Skip to content

Instantly share code, notes, and snippets.

@claudiosanches
Created August 21, 2012 04:05
Show Gist options
  • Save claudiosanches/3411403 to your computer and use it in GitHub Desktop.
Save claudiosanches/3411403 to your computer and use it in GitHub Desktop.
Current user is...
<?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