[wp-trac] [WordPress Trac] #54554: Allow returning content for wp_dropdown_roles()
WordPress Trac
noreply at wordpress.org
Mon Jul 25 20:21:59 UTC 2022
#54554: Allow returning content for wp_dropdown_roles()
-----------------------------+---------------------
Reporter: nithi22 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.1
Component: Role/Capability | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-----------------------------+---------------------
Comment (by audrasjb):
I tested the PR with the following code:
{{{
add_filter( 'admin_footer_text', function() {
echo '<select>';
wp_dropdown_roles( 'editor' );
echo '</select>';
} );
}}}
It returns the same result than before the patch.
and then I tested it with this snippet:
{{{
add_filter( 'admin_footer_text', function() {
$roles = wp_dropdown_roles( array(
'echo' => false,
) );
var_export( $roles );
} );
}}}
`$roles` is an array of roles.
Looks good to me 👍
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54554#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list