*** # WP_List_Table Base class for displaying a list of items in an ajaxified HTML table. * Full name: `\CourierNotices\Helper\WP_List_Table` ## Properties ### items The current list of items. ```php public array $items ``` *** ### _args Various information about the current table. ```php protected array $_args ``` *** ### _pagination_args Various information needed for displaying the pagination. ```php protected array $_pagination_args ``` *** ### screen The current screen. ```php protected object $screen ``` *** ### _actions Cached bulk actions. ```php private array $_actions ``` *** ### _pagination Cached pagination output. ```php private string $_pagination ``` *** ### modes The view switcher modes. ```php protected array $modes ``` *** ### _column_headers Stores the value returned by ->get_column_info(). ```php protected array $_column_headers ``` *** ### compat_fields {@internal Missing Summary} ```php protected array $compat_fields ``` *** ### compat_methods {@internal Missing Summary} ```php protected array $compat_methods ``` *** ## Methods ### __construct Constructor. ```php public __construct(array|string $args = array()): mixed ``` The child class should call this constructor from its own constructor to override the default $args. **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$args` | **array|string** | {
Array or string of arguments.

@type string $plural Plural value used for labels and the objects being listed.
This affects things such as CSS class-names and nonces used
in the list table, e.g. 'posts'. Default empty.
@type string $singular Singular label for an object being listed, e.g. 'post'.
Default empty
@type bool $ajax Whether the list table supports Ajax. This includes loading
and sorting data, for example. If true, the class will call
the _js_vars() method in the footer to provide variables
to any scripts handling Ajax events. Default false.
@type string $screen String containing the hook name used to determine the current
screen. If left null, the current screen will be automatically set.
Default null.
} | *** ### __get Make private properties readable for backward compatibility. ```php public __get(string $name): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$name` | **string** | Property to get. | **Return Value:** Property. *** ### __set Make private properties settable for backward compatibility. ```php public __set(string $name, mixed $value): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$name` | **string** | Property to check if set. | | `$value` | **mixed** | Property value. | **Return Value:** Newly-set property. *** ### __isset Make private properties checkable for backward compatibility. ```php public __isset(string $name): bool ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$name` | **string** | Property to check if set. | **Return Value:** Whether the property is set. *** ### __unset Make private properties un-settable for backward compatibility. ```php public __unset(string $name): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$name` | **string** | Property to unset. | *** ### __call Make private/protected methods readable for backward compatibility. ```php public __call(string $name, array $arguments): mixed|bool ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$name` | **string** | Method to call. | | `$arguments` | **array** | Arguments to pass when calling. | **Return Value:** Return value of the callback, false otherwise. *** ### ajax_user_can Checks the current user's permissions ```php public ajax_user_can(): mixed ``` *** ### prepare_items Prepares the list of items for displaying. ```php public prepare_items(): mixed ``` *** ### set_pagination_args An internal method that sets all the necessary pagination arguments ```php protected set_pagination_args(array|string $args): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$args` | **array|string** | Array or string of arguments with information about the pagination. | *** ### get_pagination_arg Access the pagination args. ```php public get_pagination_arg(string $key): int ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$key` | **string** | Pagination argument to retrieve. Common values include 'total_items',
'total_pages', 'per_page', or 'infinite_scroll'. | **Return Value:** Number of items that correspond to the given pagination argument. *** ### has_items Whether the table has items to display or not ```php public has_items(): bool ``` *** ### no_items Message to be displayed when there are no items ```php public no_items(): mixed ``` *** ### search_box Displays the search box. ```php public search_box(string $text, string $input_id): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$text` | **string** | The 'submit' button label. | | `$input_id` | **string** | ID attribute value for the search input field. | *** ### get_views Get an associative array ( id => link ) with the list of views available on this table. ```php protected get_views(): array ``` *** ### views Display the list of views available on this table. ```php public views(): mixed ``` *** ### get_bulk_actions Get an associative array ( option_name => option_title ) with the list of bulk actions available on this table. ```php protected get_bulk_actions(): array ``` *** ### bulk_actions Display the bulk actions dropdown. ```php protected bulk_actions(string $which = ''): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$which` | **string** | The location of the bulk actions: 'top' or 'bottom'.
This is designated as optional for backward compatibility. | *** ### current_action Get the current action selected from the bulk actions dropdown. ```php public current_action(): string|false ``` **Return Value:** The action name or False if no action was selected *** ### row_actions Generate row actions div ```php protected row_actions(string[] $actions, bool $always_visible = false): string ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$actions` | **string[]** | An array of action links. | | `$always_visible` | **bool** | Whether the actions should be always visible. | *** ### months_dropdown Display a monthly dropdown for filtering items ```php protected months_dropdown(string $post_type): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$post_type` | **string** | | *** ### view_switcher Display a view switcher ```php protected view_switcher(string $current_mode): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$current_mode` | **string** | | *** ### comments_bubble Display a comment count bubble ```php protected comments_bubble(int $post_id, int $pending_comments): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$post_id` | **int** | The post ID. | | `$pending_comments` | **int** | Number of pending comments. | *** ### get_pagenum Get the current page number ```php public get_pagenum(): int ``` *** ### get_items_per_page Get number of items to display on a single page ```php protected get_items_per_page(string $option, int $default = 20): int ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$option` | **string** | | | `$default` | **int** | | *** ### pagination Display the pagination. ```php protected pagination(string $which): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$which` | **string** | | *** ### get_columns Get a list of columns. The format is: 'internal-name' => 'Title' ```php public get_columns(): array ``` *** ### get_sortable_columns Get a list of sortable columns. The format is: 'internal-name' => 'orderby' or 'internal-name' => array( 'orderby', true ) ```php protected get_sortable_columns(): array ``` The second format will make the initial sorting order be descending *** ### get_default_primary_column_name Gets the name of the default primary column. ```php protected get_default_primary_column_name(): string ``` **Return Value:** Name of the default primary column, in this case, an empty string. *** ### get_primary_column Public wrapper for WP_List_Table::get_default_primary_column_name(). ```php public get_primary_column(): string ``` **Return Value:** Name of the default primary column. *** ### get_primary_column_name Gets the name of the primary column. ```php protected get_primary_column_name(): string ``` **Return Value:** The name of the primary column. *** ### get_column_info Get a list of all, hidden and sortable columns, with filter applied ```php protected get_column_info(): array ``` *** ### get_column_count Return number of visible columns ```php public get_column_count(): int ``` *** ### print_column_headers Print column headers, accounting for hidden and sortable columns. ```php public print_column_headers(bool $with_id = true): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$with_id` | **bool** | Whether to set the id attribute or not | *** ### display Display the table ```php public display(): mixed ``` *** ### get_table_classes Get a list of CSS classes for the WP_List_Table table tag. ```php protected get_table_classes(): array ``` **Return Value:** List of CSS classes for the table tag. *** ### display_tablenav Generate the table navigation above or below the table ```php protected display_tablenav(string $which): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$which` | **string** | | *** ### extra_tablenav Extra controls to be displayed between bulk actions and pagination ```php protected extra_tablenav(string $which): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$which` | **string** | | *** ### display_rows_or_placeholder Generate the tbody element for the list table. ```php public display_rows_or_placeholder(): mixed ``` *** ### display_rows Generate the table rows ```php public display_rows(): mixed ``` *** ### single_row Generates content for a single row of the table ```php public single_row(object $item): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$item` | **object** | The current item | *** ### column_default ```php protected column_default(object $item, string $column_name): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$item` | **object** | | | `$column_name` | **string** | | *** ### column_cb ```php protected column_cb(object $item): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$item` | **object** | | *** ### single_row_columns Generates the columns for a single row of the table ```php protected single_row_columns(object $item): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$item` | **object** | The current item | *** ### handle_row_actions Generates and display row actions links for the list table. ```php protected handle_row_actions(object $item, string $column_name, string $primary): string ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$item` | **object** | The item being acted upon. | | `$column_name` | **string** | Current column name. | | `$primary` | **string** | Primary column name. | **Return Value:** The row actions HTML, or an empty string if the current column is the primary column. *** ### ajax_response Handle an incoming ajax request (called from admin-ajax.php) ```php public ajax_response(): mixed ``` *** ### _js_vars Send required variables to JavaScript land ```php public _js_vars(): mixed ``` *** *** > Automatically generated on 2024-08-26