wppaste
WordPress

WP_MS_Sites_List_Table

Since
3.1.0
Source
wp-admin/includes/class-wp-ms-sites-list-table.php:17
Core class used to implement displaying sites 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 · 8

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

Properties · 1

$status_listarraypublic
Site status list.

Methods · 22

Source code

class WP_MS_Sites_List_Table extends WP_List_Table { 	/**	 * Site status list.	 *	 * @since 4.3.0	 * @var array	 */	public $status_list; 	/**	 * 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() ) {		$this->status_list = array(			'archived' => array( 'site-archived', __( 'Archived' ) ),			'spam'     => array( 'site-spammed', _x( 'Spam', 'site' ) ),			'deleted'  => array( 'site-deleted', __( 'Deleted' ) ),			'mature'   => array( 'site-mature', __( 'Mature' ) ),		); 		parent::__construct(			array(				'plural' => 'sites',				'screen' => isset( $args['screen'] ) ? $args['screen'] : null,			)		);	} 	/**	 * @return bool	 */	public function ajax_user_can() {		return current_user_can( 'manage_sites' );	} 	/**	 * Prepares the list of sites for display.	 *	 * @since 3.1.0	 *	 * @global string $mode List table view mode.	 * @global string $s	 * @global wpdb   $wpdb WordPress database abstraction object.	 */	public function prepare_items() {		global $mode, $s, $wpdb; 		if ( ! empty( $_REQUEST['mode'] ) ) {			$mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';			set_user_setting( 'sites_list_mode', $mode );		} else {			$mode = get_user_setting( 'sites_list_mode', 'list' );		} 		$per_page = $this->get_items_per_page( 'sites_network_per_page' ); 		$pagenum = $this->get_pagenum(); 		$s    = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';		$wild = '';		if ( str_contains( $s, '*' ) ) {			$wild = '*';			$s    = trim( $s, '*' );		} 		/*		 * If the network is large and a search is not being performed, show only		 * the latest sites with no paging in order to avoid expensive count queries.		 */		if ( ! $s && wp_is_large_network() ) {			if ( ! isset( $_REQUEST['orderby'] ) ) {				$_GET['orderby']     = '';				$_REQUEST['orderby'] = '';

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 6.8.8 tag, from src/wp-admin/includes/class-wp-ms-sites-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.