[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/includes/ -> class-wp-post-comments-list-table.php (source)

   1  <?php
   2  /**
   3   * List Table API: WP_Post_Comments_List_Table class
   4   *
   5   * @package WordPress
   6   * @subpackage Administration
   7   * @since 4.4.0
   8   */
   9  
  10  /**
  11   * Core class used to implement displaying post comments in a list table.
  12   *
  13   * @since 3.1.0
  14   *
  15   * @see WP_Comments_List_Table
  16   */
  17  class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
  18  
  19      /**
  20       * @return array
  21       */
  22  	protected function get_column_info() {
  23          return array(
  24              array(
  25                  'author'  => __( 'Author' ),
  26                  'comment' => _x( 'Comment', 'column name' ),
  27              ),
  28              array(),
  29              array(),
  30              'comment',
  31          );
  32      }
  33  
  34      /**
  35       * Gets a list of CSS classes for the WP_List_Table table tag.
  36       *
  37       * @since 3.1.0
  38       *
  39       * @return string[] Array of CSS classes for the table tag.
  40       *
  41       * @phpstan-return non-empty-list<string>
  42       */
  43  	protected function get_table_classes() {
  44          $classes   = parent::get_table_classes();
  45          $classes[] = 'wp-list-table';
  46          $classes[] = 'comments-box';
  47          return $classes;
  48      }
  49  
  50      /**
  51       * @param bool $output_empty
  52       */
  53  	public function display( $output_empty = false ) {
  54          $singular = $this->_args['singular'];
  55  
  56          wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
  57          ?>
  58  <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
  59      <tbody id="the-comment-list"
  60          <?php
  61          if ( $singular ) {
  62              echo " data-wp-lists='list:$singular'";
  63          }
  64          ?>
  65          >
  66          <?php
  67          if ( ! $output_empty ) {
  68              $this->display_rows_or_placeholder();
  69          }
  70          ?>
  71      </tbody>
  72  </table>
  73          <?php
  74      }
  75  
  76      /**
  77       * @param bool $comment_status
  78       * @return int
  79       */
  80  	public function get_per_page( $comment_status = false ) {
  81          return 10;
  82      }
  83  }


Generated : Mon Oct 12 08:20:33 2026 Cross-referenced by PHPXref