wppaste
WordPress

WP_Users_List_Table

Since
3.1.0
Source
wp-admin/includes/class-wp-users-list-table.php:17
Core class used to implement displaying users in a list table.

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 · 6

Every hook that fires from inside WP_Users_List_Table, in the order it appears in the class, grouped by the method that fires it.

Properties · 2

$site_idintpublic
Site ID to generate the Users list table for.
$is_site_usersboolpublic
Whether or not the current Users list table is for Multisite.

Methods · 14

Source code

class WP_Users_List_Table extends WP_List_Table { 	/**	 * Site ID to generate the Users list table for.	 *	 * @since 3.1.0	 * @var int	 */	public $site_id; 	/**	 * Whether or not the current Users list table is for Multisite.	 *	 * @since 3.1.0	 * @var bool	 */	public $is_site_users; 	/**	 * Constructor.	 *	 * @since 3.1.0	 *	 * @see WP_List_Table::__construct() for more information on default arguments.	 *	 * @param array $args An associative array of arguments.	 */	public function __construct( $args = array() ) {		parent::__construct(			array(				'singular' => 'user',				'plural'   => 'users',				'screen'   => $args['screen'] ?? null,			)		); 		$this->is_site_users = 'site-users-network' === $this->screen->id; 		if ( $this->is_site_users ) {			$this->site_id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0;		}	} 	/**	 * Checks the current user's permissions.	 *	 * @since 3.1.0	 *	 * @return bool	 */	public function ajax_user_can() {		if ( $this->is_site_users ) {			return current_user_can( 'manage_sites' );		} else {			return current_user_can( 'list_users' );		}	} 	/**	 * Prepares the users list for display.	 *	 * @since 3.1.0	 *	 * @global string $role	 * @global string $usersearch	 */	public function prepare_items() {		global $role, $usersearch; 		$usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : ''; 		$role = $_REQUEST['role'] ?? ''; 		$per_page       = ( $this->is_site_users ) ? 'site_users_network_per_page' : 'users_per_page';		$users_per_page = $this->get_items_per_page( $per_page ); 		$paged = $this->get_pagenum(); 		if ( 'none' === $role ) {			$args = array(

Changelog

Introduced in 3.1.0. Unchanged from 6.7.7 through 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.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-admin/includes/class-wp-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.