[wp-trac] [WordPress Trac] #24972: wp_dropdown_roles() multiple pre-selected options

WordPress Trac noreply at wordpress.org
Wed Sep 27 20:48:16 UTC 2017


#24972: wp_dropdown_roles() multiple pre-selected options
-------------------------------------+-------------------------------------
 Reporter:  PauloASilva              |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Users                    |     Version:  3.6
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-refresh  |     Focuses:  administration,
  ux-feedback                        |  template
-------------------------------------+-------------------------------------

Comment (by greenshady):

 Replying to [comment:12 melchoyce]:
 > Since there haven't really been any use cases presented for this
 feature, and default user roles within WordPress increase in privileges,
 we don't see this being useful unless someone has customized their site's
 user roles. For that reasons, we think this is plugin territory, rather
 than core. However, we're happy to hear any counter-points.

 I've got a reasonably popular role management plugin (Members) where this
 was one of the most-requested features for years.  Of course, I added the
 feature.  There are multitudes of use cases where users need to assign
 multiple roles to a user.  bbPress immediately comes to mind, but it
 handles things gracefully on its own.

 I don't believe this is something core should expose as part of the UI and
 should be left to plugins, particularly when dealing with roles/caps.

 I took a different route of handling this in my plugin.  Instead of a
 multiple select, which has problems when dealing with managing multiple
 users at once on the manage users screen, I removed the core WP select.
 Then, I replaced it with an "Add Role" dropdown and a "Remove Role"
 dropdown.  I can go into detail about why I went this route instead of a
 multiple select if need be.

 The best course of action would be to provide a filter hook for removing
 the core select role dropdown.  I had to use JavaScript to remove it from
 the screen.  Providing this would make it easier for plugins to hook in
 and do their own thing.

 We could also use a filter hook on the edit and add-new user screens too.

 > Just want to clarify — does this mean WordPress already supports
 multiple user roles by default on the API side, there's just no supported
 UI for it yet?

 Yes, it's always supported multiple roles per user since roles were
 introduced (AFAIK).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24972#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list