[wp-trac] [WordPress Trac] #38577: REST API: Allow setting user role(s) as a comma-delimited string

WordPress Trac noreply at wordpress.org
Sun Oct 30 21:54:34 UTC 2016


#38577: REST API: Allow setting user role(s) as a comma-delimited string
--------------------------+-----------------------------
 Reporter:  jnylen0       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When getting users, the `roles` property can be interpreted as a comma-
 delimited string.  Similarly to #38553, we should also interpret `roles`
 this way when creating or editing a user.

 This change also fixes 2 PHP warnings that occur when passing `roles` as a
 string:

 {{{
 PHP Warning:  Invalid argument supplied for foreach() in .../wp-includes
 /rest-api/endpoints/class-wp-rest-users-controller.php on line 744
 PHP Warning:  array_map(): Argument #2 should be an array in .../wp-
 includes/rest-api/endpoints/class-wp-rest-users-controller.php on line 360
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38577>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list