Opened 7 years ago
Closed 7 years ago
#42015 closed defect (bug) (fixed)
Ensure `wp_get_users_with_no_role()` returns the correct users when `$site_id` is passed
Reported by: | flixos90 | Owned by: | flixos90 |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Role/Capability | Keywords: | has-patch has-unit-tests |
Focuses: | multisite | Cc: |
Description
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.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
In 41654: