PHP Класс WPDKListTableViewController

## Overview 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.
Наследование: extends WP_List_Table
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$column_headers array Column header
$getStatusID string Name of GET parameter for status. Default status
$id string A string id for this list table view. This id is used in class HTML markup.
$model WPDKListTableModel An instance of WPDKListTableModel class
$title string The top head view controller title
$viewController WPDKViewController The internal view controller for this list table

Защищенные свойства (Protected)

Свойство Тип Описание
$args array Internal copy of WP_List_Table args

Открытые методы

Метод Описание
__construct ( string $id, string $title, array $args ) : WPDKListTableViewController The child class should call this constructor from it's own constructor.
_admin_head ( )
action ( ) : boolean | string Return the current action or FALSE if no action defined.
action_result ( ) : boolean | WP_Error Return the action result.
actions ( array $args, string $status ) : mixed Utility for build a right actions list when the list table is showing items.
actions_column ( array $item, string $content, string $item_status = '', string $description = '' ) : string Return the HTML markup in order to display the content of column with row actions.
admin_head ( )
admin_print_styles ( ) Fires when styles are printed for a specific admin page based on $hook_suffix.
after_display ( ) This delegate method is called after display the table, inner the form.
before_display ( ) This delegate method is called before display the table, inner the form
before_views ( ) This delegate method is called before display views
column_cb ( array $item ) : string Return the HTML markup for the checkbox element used for multiple selections.
column_checkbox ( array $item ) : boolean Return TRUE to display the checkbox, FALSE otherwise
column_default ( array $item, string $column_name ) : mixed Display a cel content for a column.
current_action ( ) : string | boolean Get the current action selected from the bulk actions dropdown.
data ( ) : array Return the items data list. This method will be over-ridden in a sub-class.
didHeadLoad ( )
display ( ) This method override the default WP_List_Table display.
get_actions_with_status ( mixed $item, string $status ) : array Return tha array with the action for the current status
get_bulk_actions ( ) : array Return an array with the list of bulk actions used in combo menu select.
get_bulk_actions_with_status ( string $status ) : array Return the array with the buk action for the combo menu for a status of view
get_columns ( ) : array Return a key value pairs array with the list of columns
get_count_statuses ( ) : array Return the array with status key => count.
get_sortable_columns ( ) : array Return the sortable columns
get_status ( string $status ) : integer Return the count of specific status
get_statuses ( ) : array Return a key value pairs array with statuses supported
get_views ( ) : array Return an array with the HTML markup list of statuses. This method use the $statuses property format as:
html ( ) : string Return the HTML markup for list table view.
load ( )
no_items ( ) 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.
prepare_items ( ) : boolean Processing data items to view.
process_bulk_action ( ) : boolean Return TRUE to stop the display of list item table, FALSE otherwise. Default return FALSE if you do not override.
search_box_field ( ) Display a search box field
statuses ( $statuses ) To override
willLoad ( )
wpdk_header_view_inner_title ( WPDKHeaderView $header_view ) Fires into the the title TAG.
wpdk_list_table_remove_query_args_redirect ( array $args = [] ) Filter the query args for redirect after an actions.

Приватные методы

Метод Описание
current_status ( string $default = '' ) : string Return the default status.

Описание методов

__construct() публичный Метод

Create an instance of WPDKListTableViewController class
public __construct ( string $id, string $title, array $args ) : WPDKListTableViewController
$id string List table id
$title string Title of view controller
$args array Standard WP_List_Table args
Результат WPDKListTableViewController

_admin_head() публичный Метод

С версии: 1.4.21
public _admin_head ( )

action() публичный Метод

Return the current action or FALSE if no action defined.
public action ( ) : boolean | string
Результат boolean | string

action_result() публичный Метод

Return the action result.
public action_result ( ) : boolean | WP_Error
Результат boolean | WP_Error

actions() публичный статический Метод

Utility for build a right actions list when the list table is showing items.
Устаревший: Use the new engine subclass - used by SamrtShop
public static actions ( array $args, string $status ) : mixed
$args array
$status string
Результат mixed

actions_column() публичный Метод

This actions are usualy: Edit | Delete | Set Trash | etc...
public actions_column ( array $item, string $content, string $item_status = '', string $description = '' ) : string
$item array The single item
$content string The content to display and link.
$item_status string Optional. Overwrite the view status for item in a specific status.
$description string Optional. Additional description not linked.
Результат string

admin_head() публичный Метод

С версии: 1.4.18
public admin_head ( )

admin_print_styles() публичный Метод

Fires when styles are printed for a specific admin page based on $hook_suffix.
С версии: 1.6.0
public admin_print_styles ( )

after_display() публичный Метод

This delegate method is called after display the table, inner the form.
С версии: 1.5.1
public after_display ( )

before_display() публичный Метод

This delegate method is called before display the table, inner the form
С версии: 1.5.1
public before_display ( )

before_views() публичный Метод

This delegate method is called before display views
С версии: 1.5.1
public before_views ( )

column_cb() публичный Метод

Return the HTML markup for the checkbox element used for multiple selections.
public column_cb ( array $item ) : string
$item array The single item from items
Результат string

column_checkbox() публичный Метод

Return TRUE to display the checkbox, FALSE otherwise
С версии: 1.5.5
public column_checkbox ( array $item ) : boolean
$item array The single item from items
Результат boolean

column_default() публичный Метод

Display a cel content for a column.
public column_default ( array $item, string $column_name ) : mixed
$item array The single item
$column_name string Column name
Результат mixed

current_action() публичный Метод

Return the action name or FALSE if no action was selected.
Устаревший: - not used
С версии: 1.5.1
public current_action ( ) : string | boolean
Результат string | boolean

data() публичный Метод

Return the items data list. This method will be over-ridden in a sub-class.
public data ( ) : array
Результат array

didHeadLoad() публичный статический Метод

public static didHeadLoad ( )

display() публичный Метод

This method override the default WP_List_Table display.
public display ( )

get_actions_with_status() публичный Метод

Return tha array with the action for the current status
public get_actions_with_status ( mixed $item, string $status ) : array
$item mixed The item
$status string Current status
Результат array

get_bulk_actions() публичный Метод

Return an array with the list of bulk actions used in combo menu select.
public get_bulk_actions ( ) : array
Результат array

get_bulk_actions_with_status() публичный Метод

Return the array with the buk action for the combo menu for a status of view
public get_bulk_actions_with_status ( string $status ) : array
$status string Current status
Результат array

get_columns() публичный Метод

Return a key value pairs array with the list of columns
public get_columns ( ) : array
Результат array

get_count_statuses() публичный Метод

Return the array with status key => count.
С версии: 1.5.16
public get_count_statuses ( ) : array
Результат array

get_sortable_columns() публичный Метод

Return the sortable columns
public get_sortable_columns ( ) : array
Результат array

get_status() публичный Метод

Return the count of specific status
Устаревший: since 1.5.16 - Use `get_count_statuses()` instead
public get_status ( string $status ) : integer
$status string
Результат integer

get_statuses() публичный Метод

Return a key value pairs array with statuses supported
public get_statuses ( ) : array
Результат array

get_views() публичный Метод

$statuses = array( 'all' => array( 'label' => __( 'All' ), 'count' => 0 ), 'publish' => array( 'label' => __( 'Publish' ), 'count' => 0 ) );
public get_views ( ) : array
Результат array

html() публичный Метод

Return the HTML markup for list table view.
public html ( ) : string
Результат string

load() публичный Метод

С версии: 1.4.18
public load ( )

no_items() публичный Метод

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.
public no_items ( )

prepare_items() публичный Метод

You can override this method to customize your retrived data.
public prepare_items ( ) : boolean
Результат boolean

process_bulk_action() публичный Метод

You can override this method to process the action request sent from list table. You can processing bulk and single action. This method must return a boolean in order to re-processed the items list view.
public process_bulk_action ( ) : boolean
Результат boolean

search_box_field() публичный Метод

Display a search box field
С версии: 1.5.1
public search_box_field ( )

statuses() публичный Метод

To override
public statuses ( $statuses )
$statuses

willLoad() публичный статический Метод

public static willLoad ( )

wpdk_header_view_inner_title() публичный Метод

Fires into the the title TAG.
public wpdk_header_view_inner_title ( WPDKHeaderView $header_view )
$header_view WPDKHeaderView An instance of WPDKHeaderView class.

wpdk_list_table_remove_query_args_redirect() публичный Метод

Filter the query args for redirect after an actions.
С версии: 1.5.17
public wpdk_list_table_remove_query_args_redirect ( array $args = [] )
$args array Optional. Default query args to remove. Default `array()`

Описание свойств

$args защищенное свойство

Internal copy of WP_List_Table args
protected array $args
Результат array

$column_headers публичное свойство

Column header
public array $column_headers
Результат array

$getStatusID публичное свойство

Name of GET parameter for status. Default status
Устаревший: sice 1.5.16 - Use `wpdk_` args instead
public string $getStatusID
Результат string

$id публичное свойство

A string id for this list table view. This id is used in class HTML markup.
public string $id
Результат string

$model публичное свойство

An instance of WPDKListTableModel class
С версии: 1.3.0
public WPDKListTableModel $model
Результат WPDKListTableModel

$title публичное свойство

The top head view controller title
public string $title
Результат string

$viewController публичное свойство

The internal view controller for this list table
public WPDKViewController $viewController
Результат WPDKViewController