_WP_List_Table_Compat::__construct()publicWP 3.1.0

Constructor.

Method of the class: _WP_List_Table_Compat{}

No Hooks.

Return

null. Nothing (null).

Usage

$_WP_List_Table_Compat = new _WP_List_Table_Compat();
$_WP_List_Table_Compat->__construct( $screen, $columns );
$screen(string|WP_Screen) (required)
The screen hook name or screen object.
$columns(string[])
An array of columns with column IDs as the keys and translated column names as the values.
Default: array()

Changelog

Since 3.1.0 Introduced.

_WP_List_Table_Compat::__construct() code WP 6.5.2

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 );
	}
}