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;
		}
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.