Opened 9 years ago
Closed 9 years ago
#42014 closed defect (bug) (fixed)
Return correct role counts in `count_users()` when passing a different site ID
| Reported by: | flixos90 | Owned by: | flixos90 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Role/Capability | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | multisite |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 41653: