[wp-trac] [WordPress Trac] #42015: Ensure `wp_get_users_with_no_role()` returns the correct users when `$site_id` is passed

WordPress Trac noreply at wordpress.org
Wed Sep 27 22:04:59 UTC 2017


#42015: Ensure `wp_get_users_with_no_role()` returns the correct users when
`$site_id` is passed
-----------------------------+------------------------------------------
 Reporter:  flixos90         |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  4.9
Component:  Role/Capability  |    Version:
 Severity:  normal           |   Keywords:  needs-patch needs-unit-tests
  Focuses:  multisite        |
-----------------------------+------------------------------------------
 When passing the `$site_id` parameter to `wp_get_users_with_no_role()`, it
 still takes the roles from the current site and creates the regular
 expression based on those, causing possibly incorrect return values.

 With the changes introduced in [41625], it is possible to easily switch
 the roles object over temporarily with `wp_roles->for_site( $site_id )`.
 This can be leveraged here to fix the bug in this function.

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


More information about the wp-trac mailing list