WP_Posts_List_Table::display_rows() WordPress Method

The display_rows() method is used by the WP_Posts_List_Table class to render the rows for a posts list table. This method iterates through the list of posts passed to it and outputs the data for each row. The data for each row is contained in an array of columns, which is passed to the display_row() method. The display_rows() method can be overridden by a subclass to provide custom behaviour.

WP_Posts_List_Table::display_rows( array $posts = array(), int $level ) #


Parameters

$posts

(array)(Optional)

Default value: array()

$level

(int)(Required)


Top ↑

Source

File: wp-admin/includes/class-wp-posts-list-table.php

	public function display_rows( $posts = array(), $level = 0 ) {
		global $wp_query, $per_page;

		if ( empty( $posts ) ) {
			$posts = $wp_query->posts;
		}

		add_filter( 'the_title', 'esc_html' );

		if ( $this->hierarchical_display ) {
			$this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page );
		} else {
			$this->_display_rows( $posts, $level );
		}
	}

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.