wppaste
WordPress

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.

Methods · 20

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 = $_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.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 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 source
3.1.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 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.