[wp-trac] [WordPress Trac] #43420: Individual role array is $wp_roles->roles does not contain role slug
WordPress Trac
noreply at wordpress.org
Sat Mar 3 08:26:45 UTC 2018
#43420: Individual role array is $wp_roles->roles does not contain role slug
------------------------------+------------------------------
Reporter: subrataemfluence | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Role/Capability | Version: 4.9.4
Severity: normal | Resolution:
Keywords: | Focuses:
------------------------------+------------------------------
Comment (by soulseekah):
The slugs are the keys, just use them in your loop.
{{{
foreach ( $wp_roles->roles as $id => $role ) {
var_dump( $id );
var_dump( $role );
}
}}}
Seems redundant and unnecessary?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43420#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list