Title: Feature Request &#8211; Missing Function &quot;get_role_name&quot;
Last modified: August 19, 2016

---

# Feature Request – Missing Function "get_role_name"

 *  [Blackbam](https://wordpress.org/support/users/blackbam/)
 * (@blackbam)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/feature-request-missing-function-get_role_name/)
 * Searching the function reference, I was not able to find a function for getting
   the role name (display name) of a user role.
 * I finally figured out a way how to get it, which took me half an hour to find
   out:
 *     ```
       $roles = new WP_Roles();
       $allroles = $roles->get_names();
       echo $allroles[$role]; // $role like 'administrator','author','custom',...
       ```
   
 * There should be a function for this in the Function Reference. Please correct
   me if I am wrong or there is a better way.

Viewing 1 replies (of 1 total)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years, 1 month ago](https://wordpress.org/support/topic/feature-request-missing-function-get_role_name/#post-2063669)
 * Maybe you’ll find help in this older post: [http://wordpress.org/support/topic/get-a-users-role-by-user-id?replies=20](http://wordpress.org/support/topic/get-a-users-role-by-user-id?replies=20)

Viewing 1 replies (of 1 total)

The topic ‘Feature Request – Missing Function "get_role_name"’ is closed to new 
replies.

## Tags

 * [capabilities](https://wordpress.org/support/topic-tag/capabilities/)
 * [display name](https://wordpress.org/support/topic-tag/display-name/)
 * [name](https://wordpress.org/support/topic-tag/name/)

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 1 reply
 * 2 participants
 * Last reply from: [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/feature-request-missing-function-get_role_name/#post-2063669)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
