ActionScheduler_Abstract_ListTable

Action Scheduler Abstract List Table class


Description Description

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:

  • Bulk actions
  • Search
    • Sortable columns
    • Automatic translations of the columns

Source Source

File: packages/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.


Top ↑

Methods Methods

  • bulk_delete — Default code for deleting entries.
  • column_cb — 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`.
  • column_default — Default column formatting, it will escape everythig for security.
  • display_admin_notices — Display the table heading and search query, if any
  • display_filter_by_status — Prints the available statuses so the user can click to filter.
  • display_header — Display the table heading and search query, if any
  • display_page — Render the list table page, including header, notices, status filters and table.
  • display_table — 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.
  • extra_tablenav
  • get_bulk_actions — 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.
  • get_columns — Returns the columns names for rendering. It adds a checkbox for selecting everything as the first column
  • get_items_offset — Returns the number of items to offset/skip for this current view.
  • get_items_query_filters — 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.
  • get_items_query_limit — Get prepared LIMIT clause for items query
  • get_items_query_offset — Get prepared OFFSET clause for items query
  • get_items_query_order — 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.
  • get_items_query_search — Check if the current request is doing a "full text" search. If that is the case prepares the SQL to search texts using LIKE.
  • get_request_order — Return the sortable column order specified for this request.
  • get_request_orderby — Return the sortable column specified for this request to order the results by, if any.
  • get_request_search_query — Return the search filter for this request, if any.
  • get_request_status — Return the status filter for this request, if any.
  • get_search_box_placeholder — Get the text to display in the search box on the list table.
  • get_sortable_columns — Reads $this->sort_by and returns the columns name in a format that WP_Table_List expects
  • get_table_columns — Process and return the columns name. This is meant for using with SQL, this means it always includes the primary key.
  • maybe_render_actions — Renders the row-actions.
  • prepare_column_headers — Prepares the _column_headers property which is used by WP_Table_List at rendering.
  • prepare_items — Prepares the data to feed WP_Table_List.
  • process_actions — Process any pending actions.
  • process_bulk_action — 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.
  • process_row_actions
  • set_items — 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 futher data transformation.
  • translate — Makes translation easier, it basically just wraps `_x` with some default (the package name). — deprecated

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.