WP_Links_List_Table
- Since
- 3.1.0
- Source
wp-admin/includes/class-wp-links-list-table.php:17
Core class used to implement displaying links in a list table.
Compatibility
- WordPress
- since 3.1.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 1
Every hook that fires from inside WP_Links_List_Table, in the order it appears in the class, grouped by the method that fires it.
Methods · 19
- __construct()Constructor.
- ajax_user_can()
- prepare_items()
- no_items()
- get_bulk_actions()
- extra_tablenav()
- get_columns()
- get_sortable_columns()
- get_default_primary_column_name()Gets the name of the default primary column.
- column_cb()Handles the checkbox column output.
- column_name()Handles the link name column output.
- column_url()Handles the link URL column output.
- column_categories()Handles the link categories column output.
- column_rel()Handles the link relation column output.
- column_visible()Handles the link visibility column output.
- column_rating()Handles the link rating column output.
- column_default()Handles the default column output.
- display_rows()Generates the list table rows.
- handle_row_actions()Generates and displays row action links.
Source code
class WP_Links_List_Table extends WP_List_Table { /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @param array $args An associative array of arguments. */ public function __construct( $args = array() ) { parent::__construct( array( 'plural' => 'bookmarks', 'screen' => isset( $args['screen'] ) ? $args['screen'] : null, ) ); } /** * @return bool */ public function ajax_user_can() { return current_user_can( 'manage_links' ); } /** * @global int $cat_id * @global string $s * @global string $orderby * @global string $order */ public function prepare_items() { global $cat_id, $s, $orderby, $order; $cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0; $orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : ''; $order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : ''; $s = ! empty( $_REQUEST['s'] ) ? sanitize_text_field( $_REQUEST['s'] ) : ''; $args = array( 'hide_invisible' => 0, 'hide_empty' => 0, ); if ( 'all' !== $cat_id ) { $args['category'] = $cat_id; } if ( ! empty( $s ) ) { $args['search'] = $s; } if ( ! empty( $orderby ) ) { $args['orderby'] = $orderby; } if ( ! empty( $order ) ) { $args['order'] = $order; } $this->items = get_bookmarks( $args ); } /** */ public function no_items() { _e( 'No links found.' ); } /** * @return array */ protected function get_bulk_actions() { $actions = array(); $actions['delete'] = __( 'Delete' ); return $actions; } /** * @global int $cat_idChangelog
Introduced in 3.1.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.1.0
Method
get_primary_column_aria_label() added.verified against source3.1.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, from
src/wp-admin/includes/class-wp-links-list-table.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.