[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-admin/includes/ -> class-wp-list-table.php (summary)

Administration API: WP_List_Table class

File Size: 1522 lines (42 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_List_Table:: (46 methods):
  __construct()
  __get()
  __set()
  __isset()
  __unset()
  __call()
  ajax_user_can()
  prepare_items()
  set_pagination_args()
  get_pagination_arg()
  has_items()
  no_items()
  search_box()
  get_views()
  views()
  get_bulk_actions()
  bulk_actions()
  current_action()
  row_actions()
  months_dropdown()
  view_switcher()
  comments_bubble()
  get_pagenum()
  get_items_per_page()
  pagination()
  get_columns()
  get_sortable_columns()
  get_default_primary_column_name()
  get_primary_column()
  get_primary_column_name()
  get_column_info()
  get_column_count()
  print_column_headers()
  display()
  get_table_classes()
  display_tablenav()
  extra_tablenav()
  display_rows_or_placeholder()
  display_rows()
  single_row()
  column_default()
  column_cb()
  single_row_columns()
  handle_row_actions()
  ajax_response()
  _js_vars()


Class: WP_List_Table  - X-Ref

Base class for displaying a list of items in an ajaxified HTML table.

__construct( $args = array()   X-Ref
Constructor.

The child class should call this constructor from its own constructor to override
the default $args.

param: array|string $args {
since: 3.1.0

__get( $name )   X-Ref
Make private properties readable for backward compatibility.

param: string $name Property to get.
since: 4.0.0
return: mixed Property.

__set( $name, $value )   X-Ref
Make private properties settable for backward compatibility.

param: string $name  Property to check if set.
param: mixed  $value Property value.
since: 4.0.0
return: mixed Newly-set property.

__isset( $name )   X-Ref
Make private properties checkable for backward compatibility.

param: string $name Property to check if set.
since: 4.0.0
return: bool Whether the property is a back-compat property and it is set.

__unset( $name )   X-Ref
Make private properties un-settable for backward compatibility.

param: string $name Property to unset.
since: 4.0.0

__call( $name, $arguments )   X-Ref
Make private/protected methods readable for backward compatibility.

param: string $name      Method to call.
param: array  $arguments Arguments to pass when calling.
since: 4.0.0
return: mixed|bool Return value of the callback, false otherwise.

ajax_user_can()   X-Ref
Checks the current user's permissions

since: 3.1.0

prepare_items()   X-Ref
Prepares the list of items for displaying.

since: 3.1.0

set_pagination_args( $args )   X-Ref
An internal method that sets all the necessary pagination arguments

param: array|string $args Array or string of arguments with information about the pagination.
since: 3.1.0

get_pagination_arg( $key )   X-Ref
Access the pagination args.

param: string $key Pagination argument to retrieve. Common values include 'total_items',
since: 3.1.0
return: int Number of items that correspond to the given pagination argument.

has_items()   X-Ref
Whether the table has items to display or not

since: 3.1.0
return: bool

no_items()   X-Ref
Message to be displayed when there are no items

since: 3.1.0

search_box( $text, $input_id )   X-Ref
Displays the search box.

param: string $text     The 'submit' button label.
param: string $input_id ID attribute value for the search input field.
since: 3.1.0

get_views()   X-Ref
Gets the list of views available on this table.

The format is an associative array:
- `'id' => 'link'`

since: 3.1.0
return: array

views()   X-Ref
Displays the list of views available on this table.

since: 3.1.0

get_bulk_actions()   X-Ref
Retrieves the list of bulk actions available for this table.

The format is an associative array where each element represents either a top level option value and label, or
an array representing an optgroup and its options.

For a standard option, the array element key is the field value and the array element value is the field label.

For an optgroup, the array element key is the label and the array element value is an associative array of
options as above.

Example:

[
'edit'         => 'Edit',
'delete'       => 'Delete',
'Change State' => [
'feature' => 'Featured',
'sale'    => 'On Sale',
]
]

since: 3.1.0
since: 5.6.0 A bulk action can now contain an array of options in order to create an optgroup.
return: array

bulk_actions( $which = '' )   X-Ref
Displays the bulk actions dropdown.

param: string $which The location of the bulk actions: 'top' or 'bottom'.
since: 3.1.0

current_action()   X-Ref
Gets the current action selected from the bulk actions dropdown.

since: 3.1.0
return: string|false The action name. False if no action was selected.

row_actions( $actions, $always_visible = false )   X-Ref
Generates the required HTML for a list of row action links.

param: string[] $actions        An array of action links.
param: bool     $always_visible Whether the actions should be always visible.
since: 3.1.0
return: string The HTML for the row actions.

months_dropdown( $post_type )   X-Ref
Displays a dropdown for filtering items in the list table by month.

param: string $post_type The post type.
since: 3.1.0

view_switcher( $current_mode )   X-Ref
Displays a view switcher.

param: string $current_mode
since: 3.1.0

comments_bubble( $post_id, $pending_comments )   X-Ref
Displays a comment count bubble.

param: int $post_id          The post ID.
param: int $pending_comments Number of pending comments.
since: 3.1.0

get_pagenum()   X-Ref
Gets the current page number.

since: 3.1.0
return: int

get_items_per_page( $option, $default_value = 20 )   X-Ref
Gets the number of items to display on a single page.

param: string $option        User option name.
param: int    $default_value Optional. The number of items to display. Default 20.
since: 3.1.0
return: int

pagination( $which )   X-Ref
Displays the pagination.

param: string $which
since: 3.1.0

get_columns()   X-Ref
Gets a list of columns.

The format is:
- `'internal-name' => 'Title'`

since: 3.1.0
return: array

get_sortable_columns()   X-Ref
Gets a list of sortable columns.

The format is:
- `'internal-name' => 'orderby'`
- `'internal-name' => array( 'orderby', 'asc' )` - The second element sets the initial sorting order.
- `'internal-name' => array( 'orderby', true )`  - The second element makes the initial order descending.

since: 3.1.0
return: array

get_default_primary_column_name()   X-Ref
Gets the name of the default primary column.

since: 4.3.0
return: string Name of the default primary column, in this case, an empty string.

get_primary_column()   X-Ref
Public wrapper for WP_List_Table::get_default_primary_column_name().

since: 4.4.0
return: string Name of the default primary column.

get_primary_column_name()   X-Ref
Gets the name of the primary column.

since: 4.3.0
return: string The name of the primary column.

get_column_info()   X-Ref
Gets a list of all, hidden, and sortable columns, with filter applied.

since: 3.1.0
return: array

get_column_count()   X-Ref
Returns the number of visible columns.

since: 3.1.0
return: int

print_column_headers( $with_id = true )   X-Ref
Prints column headers, accounting for hidden and sortable columns.

param: bool $with_id Whether to set the ID attribute or not
since: 3.1.0

display()   X-Ref
Displays the table.

since: 3.1.0

get_table_classes()   X-Ref
Gets a list of CSS classes for the WP_List_Table table tag.

since: 3.1.0
return: string[] Array of CSS classes for the table tag.

display_tablenav( $which )   X-Ref
Generates the table navigation above or below the table

param: string $which
since: 3.1.0

extra_tablenav( $which )   X-Ref
Extra controls to be displayed between bulk actions and pagination.

param: string $which
since: 3.1.0

display_rows_or_placeholder()   X-Ref
Generates the tbody element for the list table.

since: 3.1.0

display_rows()   X-Ref
Generates the table rows.

since: 3.1.0

single_row( $item )   X-Ref
Generates content for a single row of the table.

param: object|array $item The current item
since: 3.1.0

column_default( $item, $column_name )   X-Ref

param: object|array $item
param: string $column_name

column_cb( $item )   X-Ref

param: object|array $item

single_row_columns( $item )   X-Ref
Generates the columns for a single row of the table.

param: object|array $item The current item.
since: 3.1.0

handle_row_actions( $item, $column_name, $primary )   X-Ref
Generates and display row actions links for the list table.

param: object|array $item        The item being acted upon.
param: string       $column_name Current column name.
param: string       $primary     Primary column name.
since: 4.3.0
return: string The row actions HTML, or an empty string

ajax_response()   X-Ref
Handles an incoming ajax request (called from admin-ajax.php)

since: 3.1.0

_js_vars()   X-Ref
Sends required variables to JavaScript land.

since: 3.1.0



Generated: Sat Dec 14 01:00:02 2024 Cross-referenced by PHPXref 0.7.1