PHP Class Pressbooks\Admin\Catalog_List_Table

See also: http://codex.wordpress.org/Class_Reference/WP_List_Table
Inheritance: extends WP_List_Table
Exibir arquivo Open project: pressbooks/pressbooks

Public Methods

Method Description
__construct ( ) Constructor, must call parent
_js_vars ( )
addMenu ( ) WP Hook, Instantiate UI
addSearchParamsToUrl ( string $url ) : string Rebuild a URL with known search parameters
ajax_response ( )
column_cb ( array $item ) : string REQUIRED if displaying checkboxes or using bulk actions! The 'cb' column is given special treatment when columns are processed. It ALWAYS needs to have it's own method.
column_cover ( array $item ) : string
column_default ( object $item, string $column_name ) : string This method is called when the parent class can't find a method for a given column. For example, if the class needs to process a column named 'title', it would first see if a method named $this->column_title() exists. If it doesn't this one will be used.
column_status ( array $item ) : string
column_title ( array $item ) : string
get_bulk_actions ( ) : array
get_columns ( ) : array This method dictates the table's columns and titles.
get_sortable_columns ( ) : array This method merely defines which columns should be sortable and makes them clickable - it does not handle the actual sorting.
prepare_items ( ) REQUIRED! This is where you prepare your data for display. This method will usually be used to query the database, sort and filter the data, and generally get it ready to be displayed. At a minimum, we should set $this->items and $this->set_pagination_args()
print_column_headers ( boolean $with_id = true ) Form is POST not GET. Override parent method to compensate.
viewCatalogUrl ( ) : string Generate catalog URL. Dies on problem.

Protected Methods

Method Description
atLeastOneKeyword ( $keyword, array $data ) : boolean
getHiddenColumns ( ) : array TODO: This isn't well documented, not sure i'm doing it right.
getItemsData ( ) : array
renderTagColumn ( object $item, string $column_name ) : string
searchFilter ( array $data ) : array

Method Details

__construct() public method

Constructor, must call parent
public __construct ( )

_js_vars() public method

public _js_vars ( )

addMenu() static public method

WP Hook, Instantiate UI
static public addMenu ( )

addSearchParamsToUrl() static public method

Rebuild a URL with known search parameters
static public addSearchParamsToUrl ( string $url ) : string
$url string
return string

ajax_response() public method

public ajax_response ( )

atLeastOneKeyword() protected method

protected atLeastOneKeyword ( $keyword, array $data ) : boolean
$keyword
$data array
return boolean

column_cb() public method

REQUIRED if displaying checkboxes or using bulk actions! The 'cb' column is given special treatment when columns are processed. It ALWAYS needs to have it's own method.
public column_cb ( array $item ) : string
$item array A singular item (one full row's worth of data)
return string Text to be placed inside the column

column_cover() public method

public column_cover ( array $item ) : string
$item array A singular item (one full row's worth of data)
return string Text to be placed inside the column

column_default() public method

This method is called when the parent class can't find a method for a given column. For example, if the class needs to process a column named 'title', it would first see if a method named $this->column_title() exists. If it doesn't this one will be used.
See also: WP_List_Table::single_row_columns()
public column_default ( object $item, string $column_name ) : string
$item object A singular item (one full row's worth of data)
$column_name string The name/slug of the column to be processed
return string Text or HTML to be placed inside the column

column_status() public method

public column_status ( array $item ) : string
$item array A singular item (one full row's worth of data)
return string Text to be placed inside the column

column_title() public method

public column_title ( array $item ) : string
$item array A singular item (one full row's worth of data)
return string Text to be placed inside the column

getHiddenColumns() protected method

..
protected getHiddenColumns ( ) : array
return array

getItemsData() protected method

protected getItemsData ( ) : array
return array

get_bulk_actions() public method

public get_bulk_actions ( ) : array
return array An associative array containing all the bulk actions: 'slugs'=>'Visible Titles'

get_columns() public method

This method dictates the table's columns and titles.
public get_columns ( ) : array
return array An associative array containing column information: 'slugs'=>'Visible Titles'

get_sortable_columns() public method

This method merely defines which columns should be sortable and makes them clickable - it does not handle the actual sorting.
public get_sortable_columns ( ) : array
return array An associative array containing all the columns that should be sortable: 'slugs'=>array('data_values',bool)

prepare_items() public method

REQUIRED! This is where you prepare your data for display. This method will usually be used to query the database, sort and filter the data, and generally get it ready to be displayed. At a minimum, we should set $this->items and $this->set_pagination_args()
public prepare_items ( )

print_column_headers() public method

Form is POST not GET. Override parent method to compensate.
public print_column_headers ( boolean $with_id = true )
$with_id boolean

renderTagColumn() protected method

protected renderTagColumn ( object $item, string $column_name ) : string
$item object A singular item (one full row's worth of data)
$column_name string The name/slug of the column to be processed
return string Text to be placed inside the column

searchFilter() protected method

protected searchFilter ( array $data ) : array
$data array
return array

viewCatalogUrl() static public method

Generate catalog URL. Dies on problem.
static public viewCatalogUrl ( ) : string
return string