*/
class WP_MS_Users_List_Table extends WP_List_Table {
- function ajax_user_can() {
+ public function ajax_user_can() {
return current_user_can( 'manage_network_users' );
}
- function prepare_items() {
+ public function prepare_items() {
global $usersearch, $role, $wpdb, $mode;
- $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
+ $usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
$users_per_page = $this->get_items_per_page( 'users_network_per_page' );
$args['include'] = $wpdb->get_col( "SELECT ID FROM $wpdb->users WHERE user_login IN ('$logins')" );
}
- // If the network is large and a search is not being performed, show only the latest users with no paging in order
- // to avoid expensive count queries.
+ /*
+ * If the network is large and a search is not being performed,
+ * show only the latest users with no paging in order to avoid
+ * expensive count queries.
+ */
if ( !$usersearch && wp_is_large_network( 'users' ) ) {
if ( !isset($_REQUEST['orderby']) )
$_GET['orderby'] = $_REQUEST['orderby'] = 'id';
) );
}
- function get_bulk_actions() {
+ protected function get_bulk_actions() {
$actions = array();
if ( current_user_can( 'delete_users' ) )
$actions['delete'] = __( 'Delete' );
return $actions;
}
- function no_items() {
+ public function no_items() {
_e( 'No users found.' );
}
- function get_views() {
- global $wp_roles, $role;
+ protected function get_views() {
+ global $role;
$total_users = get_user_count();
$super_admins = get_super_admins();
$total_admins = count( $super_admins );
- $current_role = false;
$class = $role != 'super' ? ' class="current"' : '';
$role_links = array();
$role_links['all'] = "<a href='" . network_admin_url('users.php') . "'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
return $role_links;
}
- function pagination( $which ) {
+ /**
+ * @global string $mode
+ * @param string $which
+ */
+ protected function pagination( $which ) {
global $mode;
parent::pagination ( $which );
$this->view_switcher( $mode );
}
- function get_columns() {
+ public function get_columns() {
$users_columns = array(
'cb' => '<input type="checkbox" />',
'username' => __( 'Username' ),
return $users_columns;
}
- function get_sortable_columns() {
+ protected function get_sortable_columns() {
return array(
'username' => 'login',
'name' => 'name',
);
}
- function display_rows() {
+ public function display_rows() {
global $mode;
$alt = '';