Opened 9 years ago
Closed 9 years ago
#38577 closed defect (bug) (fixed)
REST API: Allow setting user role(s) as a comma-delimited string
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.7 | Priority: | normal |
| Severity: | normal | Version: | 4.7 |
| Component: | REST API | Keywords: | has-patch has-unit-tests |
| Focuses: | Cc: |
Description
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
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Fixed in [39056], but I typoed the ticket number.