WP_Post_Comments_List_Table::display() WordPress Method

The display() method of the WP_Post_Comments_List_Table class is used to display a list of comments for a given post. The method takes two arguments: the post ID and an array of comment data. The method first checks if the user has permission to view the comments for the given post. If the user does not have permission, the method returns false. Otherwise, the method loops through the array of comment data and outputs each comment in a table row. The method also outputs the pagination links for the comments list.

WP_Post_Comments_List_Table::display( bool $output_empty = false ) #


Parameters

$output_empty

(bool)(Optional)

Default value: false


Top ↑

Source

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

	public function display( $output_empty = false ) {
		$singular = $this->_args['singular'];

		wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
		?>
<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
	<tbody id="the-comment-list"
		<?php
		if ( $singular ) {
			echo " data-wp-lists='list:$singular'";
		}
		?>
		>
		<?php
		if ( ! $output_empty ) {
			$this->display_rows_or_placeholder();
		}
		?>
	</tbody>
</table>
		<?php
	}

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.