[wp-trac] [WordPress Trac] #38526: REST Multisite new user is not assigned to any site

WordPress Trac noreply at wordpress.org
Mon Nov 7 23:39:49 UTC 2016


#38526: REST Multisite new user is not assigned to any site
--------------------------+------------------------
 Reporter:  Compute       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.7
Component:  REST API      |     Version:
 Severity:  major         |  Resolution:
 Keywords:  needs-patch   |     Focuses:  multisite
--------------------------+------------------------

Comment (by jeremyfelt):

 In `WP_REST_Users_Controller::create_item()`, on single site, a user is
 first created and then any  roles passed with the REST request are
 assigned.

 In `add_user_to_blog()`, a single role is expected with the user.

 We could `shift` `$request['roles']` and pass that to `add_user_to_blog()`
 and then let the current loop handle any remaining roles.

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


More information about the wp-trac mailing list