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)
Viewing 1 replies (of 1 total)
- The topic ‘Current User Role’ is closed to new replies.