On this page
_WP_List_Table_Compat::__construct( string|WP_Screen $screen, string[] $columns = array() )
Constructor.
Parameters
$screenstring|WP_Screen Required-
The screen hook name or screen object.
$columnsstring[] Optional-
An array of columns with column IDs as the keys and translated column names as the values.
Default:
array()
Source
File: wp-admin/includes/class-wp-list-table-compat.php. View all references
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 );
}
}
Related
Uses
| Uses | Description |
|---|---|
| convert_to_screen() wp-admin/includes/template.php | Converts a screen string to a screen object. |
| add_filter() wp-includes/plugin.php | Adds a callback function to a filter hook. |
Used By
| Used By | Description |
|---|---|
| register_column_headers() wp-admin/includes/list-table.php | Register column headers for a particular screen. |
| print_column_headers() wp-admin/includes/list-table.php | Prints column headers for a particular screen. |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/_wp_list_table_compat/__construct