WPDK
1.5.0
WordPress Development Kit
|
Public Member Functions | |
__construct ($id, $title, $args) | |
Constructor. More... | |
get_columns () | |
Return the list of columns. More... | |
get_statuses () | |
Statuses. More... | |
get_status ($status) | |
Count status. More... | |
get_actions_with_status ($item, $status) | |
Action with status. More... | |
get_bulk_actions_with_status ($status) | |
Bulk actions. More... | |
load () | |
To override. More... | |
admin_head () | |
To override. More... | |
_admin_head () | |
To override. More... | |
display () | |
Display the list table view. More... | |
html () | |
Get the list table view. More... | |
wpdk_header_view_title_did_appear ($view) | |
Filter on title. More... | |
no_items () | |
Called when no items found. More... | |
get_views () | |
Get the top head views statuses. More... | |
statuses ($statuses) | |
Statuses. More... | |
data () | |
Return the items data list. More... | |
column_default ($item, $column_name) | |
Process the content of a column. More... | |
actions_column ($item, $column_name= 'description', $item_status= '', $custom_content= '') | |
Process the content of ID column. More... | |
column_cb ($item) | |
Standard checkbox for group actions. More... | |
get_bulk_actions () | |
Get the bulk actions. More... | |
process_bulk_action () | |
Process the bulk actions and standard actions. More... | |
urlRemveAction () | |
URL. More... | |
urlRemoveNonce () | |
URL. More... | |
urlAddNew () | |
URL. More... | |
redirect () | |
Redirect. More... | |
Static Public Member Functions | |
static | action () |
static | willLoad () |
To override. More... | |
static | didHeadLoad () |
To override. More... | |
static | actions ($args, $status) |
Return the only used action. More... | |
Data Fields | |
const | GET_STATUS = 'status' |
Default status key. More... | |
$id | |
A string id for this list table. More... | |
$title | |
View head title. More... | |
$viewController | |
View controller. More... | |
$getStatusID | |
GET id for status. More... | |
$model | |
Model. More... | |
$column_headers = array() | |
Column headers. More... | |
Protected Attributes | |
$args | |
WP_List_Table args. More... | |
An extension of WordPress WP_List_Table class.
The WPDKListTableViewController class extends the WordPress WP_List_Table class. It add some useful methods to semplify the common procedure. This class is not a true view controller (WPDKViewController) but it is very similar.
Definition at line 21 of file wpdk-listtable-viewcontroller.php.
__construct | ( | $id, | |
$title, | |||
$args | |||
) |
Constructor.
The child class should call this constructor from it's own constructor. Create an instance of WPDKListTableViewController class
string | $id | List table id |
string | $title | Title of view controller |
array | $args | Standard WP_List_Table args |
Definition at line 106 of file wpdk-listtable-viewcontroller.php.
_admin_head | ( | ) |
|
static |
Get the current action selected from the bulk actions dropdown.
Definition at line 208 of file wpdk-listtable-viewcontroller.php.
|
static |
Return the only used action.
Utility for build a right actions list when the list table is showing items.
array | $args | |
string | $status |
Definition at line 789 of file wpdk-listtable-viewcontroller.php.
actions_column | ( | $item, | |
$column_name = 'description' , |
|||
$item_status = '' , |
|||
$custom_content = '' |
|||
) |
Process the content of ID column.
The list view has a special comumn named ID. This is the primary column where are displayed some action when the mouse is over the cel. This actions are usualy: Edit | Delete | Set Trash | etc... This method return the HTML markup with description item and the list of actions.
array | $item | The single item |
string | $column_name | Optional. The column action id. Default 'description' |
string | $item_status | Optional. Overwrite the view status for item in a specific status |
string | $custom_content | Optional. Useful tuo override $custom_content |
Definition at line 698 of file wpdk-listtable-viewcontroller.php.
admin_head | ( | ) |
column_cb | ( | $item | ) |
Standard checkbox for group actions.
Return the HTML markup for the checkbox element used for multiple selections.
$item |
Definition at line 734 of file wpdk-listtable-viewcontroller.php.
column_default | ( | $item, | |
$column_name | |||
) |
Process the content of a column.
Display a cel content for a column.
array | $item | The single item |
string | $column_name | Column name |
Definition at line 674 of file wpdk-listtable-viewcontroller.php.
data | ( | ) |
Return the items data list.
Return the items data list. This method will be over-ridden in a sub-class.
Definition at line 654 of file wpdk-listtable-viewcontroller.php.
|
static |
To override.
Definition at line 373 of file wpdk-listtable-viewcontroller.php.
display | ( | ) |
Display the list table view.
This method override the default WP_List_Table display.
Definition at line 386 of file wpdk-listtable-viewcontroller.php.
get_actions_with_status | ( | $item, | |
$status | |||
) |
Action with status.
Return tha array with the action for the current status
mixed | $item | The item |
string | $status | Current status |
Definition at line 181 of file wpdk-listtable-viewcontroller.php.
get_bulk_actions | ( | ) |
Get the bulk actions.
Return an array with the list of bulk actions used in combo menu select.
Definition at line 748 of file wpdk-listtable-viewcontroller.php.
get_bulk_actions_with_status | ( | $status | ) |
Bulk actions.
Return the array with the buk action for the combo menu for a status of view
string | $status | Current status |
Definition at line 196 of file wpdk-listtable-viewcontroller.php.
get_columns | ( | ) |
Return the list of columns.
Return a key value pairs array with the list of columns
Definition at line 136 of file wpdk-listtable-viewcontroller.php.
get_status | ( | $status | ) |
Count status.
Return the count of specific status
string | $status |
Definition at line 165 of file wpdk-listtable-viewcontroller.php.
get_statuses | ( | ) |
Statuses.
Return a key value pairs array with statuses supported
Definition at line 150 of file wpdk-listtable-viewcontroller.php.
get_views | ( | ) |
Get the top head views statuses.
Return an array with the HTML markup list of statuses. This method use the $statuses property format as:
$statuses = array( 'all' => array( 'label' => __( 'All' ), 'count' => 0 ),
'publish' => array( 'label' => __( 'Publish' ), 'count' => 0 ) );
Definition at line 507 of file wpdk-listtable-viewcontroller.php.
html | ( | ) |
Get the list table view.
Return the HTML markup for list table view.
Definition at line 401 of file wpdk-listtable-viewcontroller.php.
load | ( | ) |
no_items | ( | ) |
Called when no items found.
The itens can be not found for two main reason: the query search has param tha t doesn't match with items, or the items list (or the database query) return an empty list.
Definition at line 476 of file wpdk-listtable-viewcontroller.php.
process_bulk_action | ( | ) |
Process the bulk actions and standard actions.
This method is to override and you can use it to processed the action request sent from list table. You can processed bulk and single action. This method must return a boolean in order to re-processed the items list view.
Definition at line 768 of file wpdk-listtable-viewcontroller.php.
redirect | ( | ) |
statuses | ( | $statuses | ) |
Statuses.
To override
$statuses |
Definition at line 550 of file wpdk-listtable-viewcontroller.php.
urlAddNew | ( | ) |
URL.
Return the URL to Add New item
Definition at line 863 of file wpdk-listtable-viewcontroller.php.
urlRemoveNonce | ( | ) |
URL.
Return the current URL without: _wp_http_referer
, _wpnonce
and singular id
Definition at line 845 of file wpdk-listtable-viewcontroller.php.
urlRemveAction | ( | ) |
URL.
Return the current URL without: action
and singular id
Definition at line 828 of file wpdk-listtable-viewcontroller.php.
|
static |
To override.
Definition at line 366 of file wpdk-listtable-viewcontroller.php.
wpdk_header_view_title_did_appear | ( | $view | ) |
Filter on title.
Called when the title has been drawed
WPDKHeaderView | $view | The header view |
Definition at line 454 of file wpdk-listtable-viewcontroller.php.
|
protected |
WP_List_Table args.
Internal copy of WP_List_Table args
Definition at line 71 of file wpdk-listtable-viewcontroller.php.
array $column_headers = array() |
string $getStatusID |
GET id for status.
Name of GET parameter for status. Default status
Definition at line 62 of file wpdk-listtable-viewcontroller.php.
string $id |
A string id for this list table.
A string id for this list table view. This id is used in class HTML markup.
Definition at line 35 of file wpdk-listtable-viewcontroller.php.
WPDKListTableModel $model |
Model.
An instance of WPDKListTableModel class
Definition at line 81 of file wpdk-listtable-viewcontroller.php.
string $title |
View head title.
The top head view controller title
Definition at line 44 of file wpdk-listtable-viewcontroller.php.
WPDKViewController $viewController |
View controller.
The internal view controller for this list table
Definition at line 53 of file wpdk-listtable-viewcontroller.php.
const GET_STATUS = 'status' |
Default status key.
Definition at line 26 of file wpdk-listtable-viewcontroller.php.