Make WordPress Core

Opened 7 years ago

Last modified 6 years ago

#43885 new enhancement

WP_Role and WP_Roles::get_role() missing Display Name

Reported by: garrett-eclipse's profile garrett-eclipse Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Role/Capability Keywords: dev-feedback has-patch
Focuses: Cc:

Description

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
$wp_roles->roles[$role]['name'];

Attachments (1)

43885.patch (705 bytes) - added by keraweb 6 years ago.
Add $display_name property to WP_Role class

Download all attachments as: .zip

Change History (3)

@keraweb
6 years ago

Add $display_name property to WP_Role class

#1 @keraweb
6 years ago

  • Keywords dev-feedback has-patch added

#2 @keraweb
6 years ago

Similar issue with different solution: https://core.trac.wordpress.org/ticket/34608

Note: See TracTickets for help on using tickets.