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

WordPress Trac noreply at wordpress.org
Fri Jul 25 11:00:33 UTC 2025


#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                               |  Resolution:
 Keywords:  dev-feedback has-patch needs-        |     Focuses:
  testing                                        |
-------------------------------------------------+-------------------------
Changes (by callumbw95):

 * keywords:  dev-feedback has-patch => dev-feedback has-patch needs-testing


Comment:

 Hey Everyone,

 I have just taken a look into this, and it appears that the patch is
 causing an infinite loop which is caused by calling the `WP_Roles` class
 within the `WP_Role` class. As of such I have tweaked the patch to work
 using the `global $wp_roles;` variable instead.

 I do feel like adding the display name to the `WP_Role` class is a long
 overdue feature, and it is somewhat odd how differently this class is set
 up compared to others within the codebase. Hopefully with this refreshed
 patch, and someone from the community confirming this is now working as
 intended, we can get this change into core soon. 😃

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


More information about the wp-trac mailing list