Title: Current User Role
Last modified: August 19, 2016

---

# Current User Role

 *  [nelsonkoehn](https://wordpress.org/support/users/nelsonkoehn/)
 * (@nelsonkoehn)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/current-user-role/)
 * I’m looking for a way to test for the current user’s role name. I am developing
   a dynamic menu for different role names.
    `<?php if (current_user_can('administrator')){?
   >` this seems to work well. `<?php if (current_user_can('specialrole')) { ?>`
   I can’t get this to work. Does current_user_can() only work on the default role
   names and if so is there some other way to test for the current user’s role name?
 * PS I do have a ‘specialrole’ role in my role list.

Viewing 1 replies (of 1 total)

 *  Thread Starter [nelsonkoehn](https://wordpress.org/support/users/nelsonkoehn/)
 * (@nelsonkoehn)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/current-user-role/#post-1402735)
 * I did a little more digging and it looks as if you can use this. I was having
   a conflict with Role Scoper.

Viewing 1 replies (of 1 total)

The topic ‘Current User Role’ is closed to new replies.

## Tags

 * [current_user_can](https://wordpress.org/support/topic-tag/current_user_can/)
 * [role](https://wordpress.org/support/topic-tag/role/)

 * 1 reply
 * 1 participant
 * Last reply from: [nelsonkoehn](https://wordpress.org/support/users/nelsonkoehn/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/current-user-role/#post-1402735)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
