Ticket #19765: class-wp-users-list-table.diff
File class-wp-users-list-table.diff, 1.6 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/class-wp-users-list-table.php
64 64 if ( isset( $_REQUEST['order'] ) ) 65 65 $args['order'] = $_REQUEST['order']; 66 66 67 if ( $this->is_site_users ) 68 switch_to_blog( $this->site_id ); 69 67 70 // Query the user IDs for this page 68 71 $wp_user_search = new WP_User_Query( $args ); 69 72 70 73 $this->items = $wp_user_search->get_results(); 74 75 if ( $this->is_site_users ) 76 restore_current_blog(); 71 77 72 78 $this->set_pagination_args( array( 73 79 'total_items' => $wp_user_search->get_total(), … … 86 92 $url = 'site-users.php?id=' . $this->site_id; 87 93 switch_to_blog( $this->site_id ); 88 94 $users_of_blog = count_users(); 95 $roles = wp_roles->get_names(); 89 96 restore_current_blog(); 90 97 } else { 91 98 $url = 'users.php'; 92 99 $users_of_blog = count_users(); 100 $roles = wp_roles->get_names(); 93 101 } 94 102 $total_users = $users_of_blog['total_users']; 95 103 $avail_roles =& $users_of_blog['avail_roles']; … … 99 107 $class = empty($role) ? ' class="current"' : ''; 100 108 $role_links = array(); 101 109 $role_links['all'] = "<a href='$url'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>'; 102 foreach ( $ wp_roles->get_names()as $this_role => $name ) {110 foreach ( $roles as $this_role => $name ) { 103 111 if ( !isset($avail_roles[$this_role]) ) 104 112 continue; 105 113