Opened 8 years ago
Closed 8 years ago
#42014 closed defect (bug) (fixed)
Return correct role counts in `count_users()` when passing a different site ID
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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 count_users(), users for that site are counted. However, the available roles are still taken from the current site which is unexpected behavior.
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 41653: