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

  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. * @access private 
  15. * 
  16. * @see WP_Comments_List_Table 
  17. */ 
  18. class WP_Post_Comments_List_Table extends WP_Comments_List_Table { 
  19.  
  20. /** 
  21. * 
  22. * @return array 
  23. */ 
  24. protected function get_column_info() { 
  25. return array( 
  26. array( 
  27. 'author' => __( 'Author' ),  
  28. 'comment' => _x( 'Comment', 'column name' ),  
  29. ),  
  30. array(),  
  31. array(),  
  32. 'comment',  
  33. ); 
  34.  
  35. /** 
  36. * 
  37. * @return array 
  38. */ 
  39. protected function get_table_classes() { 
  40. $classes = parent::get_table_classes(); 
  41. $classes[] = 'wp-list-table'; 
  42. $classes[] = 'comments-box'; 
  43. return $classes; 
  44.  
  45. /** 
  46. * 
  47. * @param bool $output_empty 
  48. */ 
  49. public function display( $output_empty = false ) { 
  50. $singular = $this->_args['singular']; 
  51.  
  52. wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 
  53. ?> 
  54. <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;"> 
  55. <tbody id="the-comment-list"<?php 
  56. if ( $singular ) { 
  57. echo " data-wp-lists='list:$singular'"; 
  58. } ?>> 
  59. <?php if ( ! $output_empty ) { 
  60. $this->display_rows_or_placeholder(); 
  61. } ?> 
  62. </tbody> 
  63. </table> 
  64. <?php 
  65.  
  66. /** 
  67. * 
  68. * @param bool $comment_status 
  69. * @return int 
  70. */ 
  71. public function get_per_page( $comment_status = false ) { 
  72. return 10; 
.