| @@ -33,8 +33,10 @@ | ||
| 33 | 33 | require_once __DIR__ . '/parts/permissions.php'; |
| 34 | 34 | require_once __DIR__ . '/parts/login-tracker.php'; |
| 35 | 35 | require_once __DIR__ . '/parts/color-schemes.php'; |
| 36 | 36 | require_once __DIR__ . '/parts/fields.php'; |
| 37 | +require_once __DIR__ . '/parts/roles-summary.php'; | |
| 38 | +require_once __DIR__ . '/parts/activity-summary.php'; | |
| 37 | 39 | require_once __DIR__ . '/parts/facts.php'; |
| 38 | 40 | require_once __DIR__ . '/parts/rest.php'; |
| 39 | 41 | require_once __DIR__ . '/parts/profile-script.php'; |
| 40 | 42 | |
| @@ -56,8 +58,16 @@ | ||
| 56 | 58 | $search = trim( (string) $state->get( 'search' ) ); |
| 57 | 59 | if ( '' !== $search ) { |
| 58 | 60 | $query['search'] = $search; |
| 59 | 61 | } |
| 62 | + $role = trim( (string) $state->get( 'role' ) ); | |
| 63 | + if ( 'none' === $role ) { | |
| 64 | + // As users.php does: the accounts with no role on this site, or nobody. | |
| 65 | + $ids = wp_get_users_with_no_role(); | |
| 66 | + $query['include'] = $ids ? array_map( 'intval', $ids ) : array( 0 ); | |
| 67 | + } elseif ( '' !== $role ) { | |
| 68 | + $query['roles'] = $role; | |
| 69 | + } | |
| 60 | 70 | return $query; |
| 61 | 71 | } |
| 62 | 72 | |
| 63 | 73 | /** |
| @@ -113,8 +123,13 @@ | ||
| 113 | 123 | array( |
| 114 | 124 | 'page' => 1, |
| 115 | 125 | 'perPage' => 20, |
| 116 | 126 | 'search' => '', |
| 127 | + // The role filter: a slug, or `none` for accounts with no | |
| 128 | + // role on this site, as `users.php?role=none` spells it. A | |
| 129 | + // server-side scope, so a group picked on the Roles tab is | |
| 130 | + // a fresh collection rather than a slice of the loaded pages. | |
| 131 | + 'role' => '', | |
| 117 | 132 | // The presence filter (All / Online / Active 30d / Never |
| 118 | 133 | // logged in) — a client-side slice of the page. |
| 119 | 134 | 'status' => '', |
| 120 | 135 | 'orderby' => 'name', |