I am looking for a neat way to get the Wordpress role display name.
When you add the role (e.g. add_role( 'special', 'A Special Role');
), you get to set a display name.
When you get the role (e.g. get_role( 'special' );
) the role object returned simply has the name and the capabilities object.
WP_Role Object(
[name] => special
[capabilities] => Array() )
And no display name. The display name is used all over the WP Admin back-end (users.php and user-edit.php), but it's a rabbit warren ... and I haven't been able to find a function that will return it. You can readily see it in the wp_user_roles
row in the wp-options
table - surely I don't need to go there?