[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
Sat Sep 30 04:09:13 UTC 2017


#42015: Ensure `wp_get_users_with_no_role()` returns the correct users when
`$site_id` is passed
--------------------------------------+------------------------
 Reporter:  flixos90                  |       Owner:  flixos90
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  4.9
Component:  Role/Capability           |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+------------------------
Changes (by flixos90):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"41654"]:
 {{{
 #!CommitTicketReference repository="" revision="41654"
 Multisite: Fix `wp_get_users_with_no_role()` possibly including users with
 a role on a different site.

 Prior to this change, when passing another site than the current one to
 `wp_get_users_with_no_role()` through its `$site_id` parameter, the
 function still used the roles available on the current site, which would
 cause users with other roles that possibly exist on the other site to show
 up as users without a role. Switching the site before retrieving the
 available rules fixes the issue.

 Fixes #42015.
 }}}

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


More information about the wp-trac mailing list