WP_Posts_List_Table::no_items() WordPress Method
The WP_Posts_List_Table::no_items() method is used to display a message when there are no posts to display in a WordPress posts list table. This method is typically used in the WP_Posts_List_Table::display() method, where it is called if the $this->items property is empty. The no_items() method takes two arguments: $singular: The singular label for the post type. $plural: The plural label for the post type. The default implementation of the no_items() method displays a message like "No posts found."
WP_Posts_List_Table::no_items() #
Source
File: wp-admin/includes/class-wp-posts-list-table.php
public function no_items() { if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) { echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash; } else { echo get_post_type_object( $this->screen->post_type )->labels->not_found; } }
Expand full source codeCollapse full source codeView on TracView on GitHub