WP_MS_Users_List_Table
- Since
- 3.1.0
- Source
wp-admin/includes/class-wp-ms-users-list-table.php:17
Core class used to implement displaying users in a list table for the network admin.
Compatibility
- WordPress
- since 3.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 7
Every hook that fires from inside WP_MS_Users_List_Table, in the order it appears in the class, grouped by the method that fires it.
WP_MS_Users_List_Table::column_blogs()
- apply_filters( ms_user_list_site_class )filter line 398
- apply_filters( ms_user_list_site_actions )filter line 438
Methods · 20
- ajax_user_can()
- prepare_items()
- get_bulk_actions()
- no_items()
- get_views()
- pagination()
- get_columns()
- get_sortable_columns()
- column_cb()Handles the checkbox column output.
- column_id()Handles the ID column output.
- column_username()Handles the username column output.
- column_name()Handles the name column output.
- column_email()Handles the email column output.
- column_registered()Handles the registered date column output.
- _column_blogs()
- column_blogs()Handles the sites column output.
- column_default()Handles the default column output.
- display_rows()Generates the list table rows.
- get_default_primary_column_name()Gets the name of the default primary column.
- handle_row_actions()Generates and displays row action links.
Source code
class WP_MS_Users_List_Table extends WP_List_Table { /** * @return bool */ public function ajax_user_can() { return current_user_can( 'manage_network_users' ); } /** * @global string $mode List table view mode. * @global string $usersearch * @global string $role */ public function prepare_items() { global $mode, $usersearch, $role; if ( ! empty( $_REQUEST['mode'] ) ) { $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list'; set_user_setting( 'network_users_list_mode', $mode ); } else { $mode = get_user_setting( 'network_users_list_mode', 'list' ); } $usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : ''; $users_per_page = $this->get_items_per_page( 'users_network_per_page' ); $role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : ''; $paged = $this->get_pagenum(); $args = array( 'number' => $users_per_page, 'offset' => ( $paged - 1 ) * $users_per_page, 'search' => $usersearch, 'blog_id' => 0, 'fields' => 'all_with_meta', ); if ( wp_is_large_network( 'users' ) ) { $args['search'] = ltrim( $args['search'], '*' ); } elseif ( '' !== $args['search'] ) { $args['search'] = trim( $args['search'], '*' ); $args['search'] = '*' . $args['search'] . '*'; } if ( 'super' === $role ) { $args['login__in'] = get_super_admins(); } /* * 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'] = 'id'; $_REQUEST['orderby'] = 'id'; } if ( ! isset( $_REQUEST['order'] ) ) { $_GET['order'] = 'DESC'; $_REQUEST['order'] = 'DESC'; } $args['count_total'] = false; } if ( isset( $_REQUEST['orderby'] ) ) { $args['orderby'] = $_REQUEST['orderby']; } if ( isset( $_REQUEST['order'] ) ) { $args['order'] = $_REQUEST['order']; } /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */ $args = apply_filters( 'users_list_table_query_args', $args ); // Query the user IDs for this page. $wp_user_search = new WP_User_Query( $args );Changelog
Introduced in 3.1.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.1.0
Method
get_primary_column_aria_label() added.verified against source3.1.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, from
src/wp-admin/includes/class-wp-ms-users-list-table.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.