Make WordPress Core

Opened 4 years ago

#49924 assigned enhancement

Support for Multiple selected options in wp_dropdown_roles() function

Reported by: abdulawal39's profile abdulawal39 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4
Component: Users Keywords: has-patch
Focuses: administration Cc:


Currently wp_dropdown_roles() function accepts $selected parameter as string which is perfect for select tags but in some cases we may need to use this function with multi select tags.

To solve this, I've slightly modified the function to accept both string and array for selected items. User may now pass one or more role names separated by comma or an array of role names.

Going to submit patch for this.

Attachments (1)

49924.diff (1.1 KB) - added by abdulawal39 4 years ago.
Updated function code

Download all attachments as: .zip

Change History (1)

4 years ago

Updated function code

Note: See TracTickets for help on using tickets.