$table_name
$table_name : string
The table name
Action Scheduler Abstract List Table class
This abstract class enhances WP_List_Table making it ready to use.
By extending this class we can focus on describing how our table looks like, which columns needs to be shown, filter, ordered by and more and forget about the details.
This class supports:
$table_name : string
The table name
$package : string
Package name, used to get options from WP_List_Table::get_items_per_page.
$items_per_page : int
How many items do we render per page?
$search_by : array
Enables search in this table listing. If this array is empty it means the listing is not searchable.
$columns : array
Columns to show in the table listing. It is a key => value pair. The key must much the table column name and the value is the label, which is automatically translated.
$row_actions : array
Defines the row-actions. It expects an array where the key is the column name and the value is an array of actions.
The array of actions are key => value, where key is the method name (with the prefix rowaction<key>) and the value is the label and title.
$ID : string
The Primary key of our table
$sort_by : array
Enables sorting, it expects an array of columns (the column names are the values)
$filter_by : string
The default sort order
$status_counts : array
The status name => count combinations for this table's items. Used to display status filters.
$admin_notices : array
Notices to display when loading the table. Array of arrays of form array( 'class' => {updated|error}, 'message' => 'This is the notice text display.' ).
$table_header : string
Localised string displayed in the <h1> element above the able.
$bulk_actions : array
Enables bulk actions. It must be an array where the key is the action name and the value is the label (which is translated automatically). It is important to notice that it will check that the method exists (`bulk_$name`) and will throw an exception if it does not exists.
This class will automatically check if the current request has a bulk action, will do the
validations and afterwards will execute the bulk method, with two arguments. The first argument
is the array with primary keys, the second argument is a string with a list of the primary keys,
escaped and ready to use (with IN
).
prepare_items() : mixed
Prepares the data to feed WP_Table_List.
This has the core for selecting, sorting and filtering data. To keep the code simple its logic is split among many methods (get_itemsquery*).
Beside populating the items this function will also count all the records that matches the filtering criteria and will do fill the pagination variables.
column_cb(array $row) : mixed
Renders the checkbox for each row, this is the first column and it is named ID regardless of how the primary key is named (to keep the code simpler). The bulk actions will do the proper name transformation though using `$this->ID`.
array | $row | The row to render. |
get_bulk_actions() : array
Reads `$this->bulk_actions` and returns an array that WP_List_Table understands. It also validates that the bulk method handler exists. It throws an exception because this is a library meant for developers and missing a bulk method is a development-time error.
Throws RuntimeException when the bulk action does not have a callback method.
None found |
process_bulk_action() : mixed
Checks if the current request has a bulk action. If that is the case it will validate and will execute the bulk method handler. Regardless if the action is valid or not it will redirect to the previous page removing the current arguments that makes this request a bulk action.
None found |
bulk_delete(array $ids, string $ids_sql) : void
Default code for deleting entries.
validated already by process_bulk_action()
array | $ids | ids of the items to delete. |
string | $ids_sql | the sql for the ids. |
None found |
prepare_column_headers() : mixed
Prepares the _column_headers property which is used by WP_Table_List at rendering.
It merges the columns and the sortable columns.
None found |
get_items_query_limit() : string
Get prepared LIMIT clause for items query
Prepared LIMIT clause for items query.
global |
wpdb $wpdb |
---|
get_items_offset() : int
Returns the number of items to offset/skip for this current view.
None found |
get_items_query_offset() : string
Get prepared OFFSET clause for items query
Prepared OFFSET clause for items query.
global |
wpdb $wpdb |
---|
get_items_query_order() : mixed
Prepares the ORDER BY sql statement. It uses `$this->sort_by` to know which columns are sortable. This requests validates the orderby $_GET parameter is a valid column and sortable. It will also use order (ASC|DESC) using DESC by default.
None found |
get_request_query_args_to_persist() : string[]
Querystring arguments to persist between form submissions.
since | 3.7.3 |
---|
get_request_orderby() : string
Return the sortable column specified for this request to order the results by, if any.
None found |
get_request_order() : string
Return the sortable column order specified for this request.
None found |
get_request_status() : string
Return the status filter for this request, if any.
None found |
get_request_search_query() : string
Return the search filter for this request, if any.
None found |
get_table_columns() : array
Process and return the columns name. This is meant for using with SQL, this means it always includes the primary key.
None found |
get_items_query_search() : string
Check if the current request is doing a "full text" search. If that is the case prepares the SQL to search texts using LIKE.
If the current request does not have any search or if this list table does not support that feature it will return an empty string.
None found |
get_items_query_filters() : mixed
Prepares the SQL to filter rows by the options defined at `$this->filter_by`. Before trusting any data sent by the user it validates that it is a valid option.
None found |
set_items(array $items) : mixed
Set the data for displaying. It will attempt to unserialize (There is a chance that some columns are serialized). This can be override in child classes for further data transformation.
array | $items | Items array. |
None found |
maybe_render_actions(array $row, string $column_name) : string
Renders the row-actions.
This method renders the action menu, it reads the definition from the $row_actions property, and it checks that the row action method exists before rendering it.
array | $row | Row to be rendered. |
string | $column_name | Column name. |
None found |
None found |
display_header() : mixed
Display the table heading and search query, if any
None found |
display_admin_notices() : mixed
Display the table heading and search query, if any
None found |
display_filter_by_status() : mixed
Prints the available statuses so the user can click to filter.
None found |
display_table() : mixed
Renders the table list, we override the original class to render the table inside a form and to render any needed HTML (like the search box). By doing so the callee of a function can simple forget about any extra HTML.
None found |
get_search_box_placeholder() : mixed
Get the text to display in the search box on the list table.
None found |
get_per_page_option_name() : string
Gets the screen per_page option name.
None found |