Skip to content

Instantly share code, notes, and snippets.

@fearlex
Created October 3, 2016 23:33
Show Gist options
  • Save fearlex/e33fcc8774e9d64e47672e677665c9a9 to your computer and use it in GitHub Desktop.
Save fearlex/e33fcc8774e9d64e47672e677665c9a9 to your computer and use it in GitHub Desktop.
Get Current User Role name.
// -- Get Current User Role.
global $wp_roles;
$roles = wp_get_current_user()->roles[ 0 ];
$role_display = $wp_roles->roles[ $roles ][ 'name' ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment