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 ) #
Contents
Parameters
- $output_empty
(bool)(Optional)
Default value: false
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 }
Expand full source codeCollapse full source codeView on TracView on GitHub