_WP_List_Table_Compat::__construct() WordPress Method

This method is used to create a new WP_List_Table_Compat object. It takes two parameters: The first parameter is an array of data that will be used to populate the table. The second parameter is an array of options that can be used to customize the table.

_WP_List_Table_Compat::__construct( string|WP_Screen $screen, string[] $columns = array() ) #

Constructor.


Parameters

$screen

(string|WP_Screen)(Required)The screen hook name or screen object.

$columns

(string[])(Optional)An array of columns with column IDs as the keys and translated column names as the values.

Default value: array()


Top ↑

Source

File: wp-admin/includes/class-wp-list-table-compat.php

	public function __construct( $screen, $columns = array() ) {
		if ( is_string( $screen ) ) {
			$screen = convert_to_screen( $screen );
		}

		$this->_screen = $screen;

		if ( ! empty( $columns ) ) {
			$this->_columns = $columns;
			add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 );
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.