Make WordPress Core

Opened 6 years ago

#49924 assigned enhancement

Support for Multiple selected options in wp_dropdown_roles() function

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

Description

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 6 years ago.
Updated function code

Download all attachments as: .zip

Change History (1)

@abdulawal39
6 years ago

Updated function code

Note: See TracTickets for help on using tickets.