Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix the issue where non-editable roles are listed on the edit roles p…

…age.
  • Loading branch information...
commit 10fc3d9aa37a0cec8ae204a3b3fdc1d68934de38 1 parent 891be84
@justintadlock authored
Showing with 4 additions and 7 deletions.
  1. +1 −4 admin/roles-list-table.php
  2. +3 −3 includes/functions.php
View
5 admin/roles-list-table.php
@@ -6,9 +6,6 @@
* @subpackage Admin
*/
-/* Get the global $wp_roles variable. */
-global $wp_roles;
-
/* Get a count of all the roles available. */
$roles_count = members_count_roles();
@@ -40,7 +37,7 @@
$role_status = 'all';
/* Set up the roles array. */
- $list_roles = $wp_roles->role_names;
+ $list_roles = array_merge( $active_roles, $inactive_roles );
/* Set the current page URL. */
$current_page = $current_page = admin_url( 'users.php?page=roles' );
View
6 includes/functions.php
@@ -35,7 +35,7 @@ function members_count_roles() {
global $wp_roles;
if ( !empty( $wp_roles->role_names ) )
- return count( $wp_roles->role_names );
+ return count( apply_filters( 'editable_roles', $wp_roles->role_names ) );
return false;
}
@@ -52,7 +52,7 @@ function members_get_active_roles() {
$active = array();
- foreach ( $wp_roles->role_names as $role => $name ) {
+ foreach ( apply_filters( 'editable_roles', $wp_roles->role_names ) as $role => $name ) {
$count = members_get_role_user_count( $role );
@@ -78,7 +78,7 @@ function members_get_inactive_roles() {
$inactive = array();
- foreach ( $wp_roles->role_names as $role => $name ) {
+ foreach ( apply_filters( 'editable_roles', $wp_roles->role_names ) as $role => $name ) {
$count = members_get_role_user_count( $role );
Please sign in to comment.
Something went wrong with that request. Please try again.