Ticket #19765: class-wp-users-list-table.patch
File class-wp-users-list-table.patch, 1.7 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 73 if ( $this->is_site_users ) 74 switch_to_blog( $this->site_id ); 75 70 76 $this->items = $wp_user_search->get_results(); 77 78 if ( $this->is_site_users ) 79 restore_current_blog(); 71 80 72 81 $this->set_pagination_args( array( 73 82 'total_items' => $wp_user_search->get_total(), … … 86 95 $url = 'site-users.php?id=' . $this->site_id; 87 96 switch_to_blog( $this->site_id ); 88 97 $users_of_blog = count_users(); 98 $roles = wp_roles->get_names(); 89 99 restore_current_blog(); 90 100 } else { 91 101 $url = 'users.php'; 92 102 $users_of_blog = count_users(); 103 $roles = wp_roles->get_names(); 93 104 } 94 105 $total_users = $users_of_blog['total_users']; 95 106 $avail_roles =& $users_of_blog['avail_roles']; … … 99 110 $class = empty($role) ? ' class="current"' : ''; 100 111 $role_links = array(); 101 112 $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 ) {113 foreach ( $roles as $this_role => $name ) { 103 114 if ( !isset($avail_roles[$this_role]) ) 104 115 continue; 105 116