Class: AC\ListScreen

The AC\ListScreen class contains all information about the WordPress List Table and its columns.

The class is located at /admin-columns/classes/ListScreen.php and can be viewed on github. Please read over the extended comments found above each function to learn more.


Method and properties

get_id() : AC\Type\ListScreenID

The `ListScreenId` is a unique identifier that is assigned when the ListScreen settings has been stored in the database. e.g. 5eeca96a61826


get_layout_id() : string

Same as get_id(), but this method will return a string. e.g. 5eeca96a61826

The List Screen ID can be shown on the columns settings page by opening screen options (in the top-right corner) and then enabling List Screen ID.


get_key() : string

The `Key` is a hard-coded identifier for each type of list screen. There are multiple types of list screens:

Examples

List Screen / List Table Key Returns
Posts $post_type post
Pages $post_type page
Users wp-users wp-users
Network Users wp-ms_users wp-ms_users
Media wp-media wp-media
Comments wp-comments wp-comments
Categories wp-taxonomy_{$term} wp-taxonomy_category
Tags wp-taxonomy_{$term} wp-taxonomy_post_tag

The List Screen Key can be shown on the columns settings page by opening screen options (in the top-right corner) and then enabling List Screen Key.


get_label() : string

Returns its label (string) For example Post, User, or Comment.


get_meta_type() : string

Returns its meta-type (string). e.g. post, user, comment or term

This method is mostly used when working with custom metadata.
e.g. get_metadata( $list_screen->get_meta_type(), 1346, 'custom_key' );


get_screen_id() : string

Returns the WP_Screen::ID


get_columns() : AC\Column[]

Returns all stored AC\Column objects


get_column_types() : AC\Column[]

Return an array of available column types for the current list screen


The list screen is available from the AC\Column object by calling the AC\Column::get_list_screen() method.

Still need help? Contact Us Contact Us