WP_Posts_List_Table
- Since
- 3.1.0
- Source
wp-admin/includes/class-wp-posts-list-table.php:17
Core class used to implement displaying posts 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 · 28
Every hook that fires from inside WP_Posts_List_Table, in the order it appears in the class, grouped by the method that fires it.
WP_Posts_List_Table::categories_dropdown()
- apply_filters( disable_categories_dropdown )filter line 475
WP_Posts_List_Table::extra_tablenav()
- do_action( restrict_manage_posts )action line 593
- do_action( manage_posts_extra_tablenav )action line 619
WP_Posts_List_Table::get_columns()
- apply_filters( manage_taxonomies_for_{$post_type}_columns )filter line 688
- apply_filters( manage_pages_columns )filter line 727
- apply_filters( manage_posts_columns )filter line 738
- apply_filters( manage_{$post_type}_posts_columns )filter line 755
WP_Posts_List_Table::column_title()
- apply_filters( the_title )filter line 1110
- apply_filters( quick_edit_enabled_for_post_type )filter line 1174
WP_Posts_List_Table::column_date()
- apply_filters( post_date_column_status )filter line 1232
- apply_filters( post_date_column_time )filter line 1251
WP_Posts_List_Table::column_default()
- apply_filters( post_column_taxonomy_links )filter line 1353
- do_action( manage_pages_custom_column )action line 1375
- do_action( manage_posts_custom_column )action line 1389
- do_action( manage_{$post->post_type}_posts_custom_column )action line 1407
WP_Posts_List_Table::handle_row_actions()
- apply_filters( quick_edit_enabled_for_post_type )filter line 1500
- apply_filters( page_row_actions )filter line 1589
- apply_filters( post_row_actions )filter line 1604
WP_Posts_List_Table::inline_edit()
- apply_filters( quick_edit_show_taxonomy )filter line 1643
- apply_filters( quick_edit_dropdown_authors_args )filter line 1758
- apply_filters( quick_edit_dropdown_pages_args )filter line 1863
- apply_filters( default_page_template_title )filter line 1892
- apply_filters( quick_edit_statuses )filter line 2015
- do_action( bulk_edit_custom_box )action line 2091
- do_action( quick_edit_custom_box )action line 2103
Properties · 6
$hierarchical_displayboolprotected- Whether the items should be displayed hierarchically or linearly.
$comment_pending_countarrayprotected- Holds the number of pending comments for each post.
$user_posts_countintprivate- Holds the number of posts for this user.
$sticky_posts_countintprivate- Holds the number of posts which are sticky.
$is_trashprivate$current_levelintprotected- Current level for output.
Methods · 32
- __construct()Constructor.
- set_hierarchical_display()Sets whether the table layout should be hierarchical or not.
- ajax_user_can()
- prepare_items()
- has_items()
- no_items()
- is_base_request()Determines if the current view is the "All" view.
- get_edit_link()Creates a link to edit.php with params.
- get_views()
- get_bulk_actions()
- categories_dropdown()Displays a categories drop-down for filtering on the Posts list table.
- formats_dropdown()Displays a formats drop-down for filtering items.
- extra_tablenav()
- current_action()
- get_table_classes()
- get_columns()
- get_sortable_columns()
- display_rows()Generates the list table rows.
- _display_rows()
- _display_rows_hierarchical()
- _page_rows()Displays the nested hierarchy of sub-pages together with paging support, based on a top level page ID.
- column_cb()Handles the checkbox column output.
- _column_title()
- column_title()Handles the title column output.
- column_date()Handles the post date column output.
- column_comments()Handles the comments column output.
- column_author()Handles the post author column output.
- column_default()Handles the default column output.
- single_row()
- get_default_primary_column_name()Gets the name of the default primary column.
- handle_row_actions()Generates and displays row action links.
- inline_edit()Outputs the hidden row displayed when inline editing
Source code
<?phpclass WP_Posts_List_Table extends WP_List_Table { /** * Whether the items should be displayed hierarchically or linearly. * * @since 3.1.0 * @var bool */ protected $hierarchical_display; /** * Holds the number of pending comments for each post. * * @since 3.1.0 * @var array */ protected $comment_pending_count; /** * Holds the number of posts for this user. * * @since 3.1.0 * @var int */ private $user_posts_count; /** * Holds the number of posts which are sticky. * * @since 3.1.0 * @var int */ private $sticky_posts_count = 0; private $is_trash; /** * Current level for output. * * @since 4.3.0 * @var int */ protected $current_level = 0; /** * Constructor. * * @since 3.1.0 * * @see WP_List_Table::__construct() for more information on default arguments. * * @global WP_Post_Type $post_type_object Global post type object. * @global wpdb $wpdb WordPress database abstraction object. * * @param array $args An associative array of arguments. */ public function __construct( $args = array() ) { global $post_type_object, $wpdb; parent::__construct( array( 'plural' => 'posts', 'screen' => $args['screen'] ?? null, ) ); $post_type = $this->screen->post_type; $post_type_object = get_post_type_object( $post_type ); $exclude_states = get_post_stati( array( 'show_in_admin_all_list' => false, ) ); $this->user_posts_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %sChangelog
Introduced in 3.1.0. 2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.1.0
Method
get_no_title_excerpt() added.verified against source7.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 7.0.4 tag, from
src/wp-admin/includes/class-wp-posts-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.