[wp-trac] [WordPress Trac] #43885: WP_Role and WP_Roles::get_role() missing Display Name

WordPress Trac noreply at wordpress.org
Fri Apr 27 21:19:41 UTC 2018


#43885: WP_Role and WP_Roles::get_role() missing Display Name
-----------------------------+-----------------------------
 Reporter:  garrett-eclipse  |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Role/Capability  |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Hello,

 While working with roles I found it odd that you can add a Display Name
 for a role but the WP_Role class and the WP_Roles function get_role don't
 provide this information.

 Please add $display_name as a public attribute of WP_Role so it's
 available on that object and would be returned in the get_role function.

 Thank you
 P.S. Currently to access this information you have to use the WP_Roles as
 follows;
 {{{#!php
 <?php
 $wp_roles->roles[$role]['name'];
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43885>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list