@@ -70,18 +70,22 @@ public function floated_admin_avatar( $name, $comment_id ) {
7070 }
7171
7272 /**
73- * @return bool
73+ * Checks if the user can edit posts.
74+ *
75+ * @return bool Whether the user can edit posts.
7476 */
7577 public function ajax_user_can () {
7678 return current_user_can ( 'edit_posts ' );
7779 }
7880
7981 /**
80- * @global string $mode List table view mode.
81- * @global int $post_id
82- * @global string $comment_status
83- * @global string $comment_type
84- * @global string $search
82+ * Prepares the comments list items.
83+ *
84+ * @global string $mode Current list table display mode.
85+ * @global int $post_id Current post ID filter.
86+ * @global string $comment_status Comment status filter.
87+ * @global string $comment_type Comment type filter.
88+ * @global string $search Search term.
8589 */
8690 public function prepare_items () {
8791 global $ mode , $ post_id , $ comment_status , $ comment_type , $ search ;
@@ -151,6 +155,7 @@ public function prepare_items() {
151155 'number ' => $ number ,
152156 'post_id ' => $ post_id ,
153157 'type ' => $ comment_type ,
158+ 'type__not_in ' => array ( 'note ' ),
154159 'orderby ' => $ orderby ,
155160 'order ' => $ order ,
156161 'post_type ' => $ post_type ,
@@ -198,8 +203,10 @@ public function prepare_items() {
198203 }
199204
200205 /**
201- * @param string $comment_status
202- * @return int
206+ * Gets the number of comments to display per page.
207+ *
208+ * @param string $comment_status Comment status.
209+ * @return int Comments per page.
203210 */
204211 public function get_per_page ( $ comment_status = 'all ' ) {
205212 $ comments_per_page = $ this ->get_items_per_page ( 'edit_comments_per_page ' );
@@ -216,6 +223,8 @@ public function get_per_page( $comment_status = 'all' ) {
216223 }
217224
218225 /**
226+ * Displays a message when no comments are found.
227+ *
219228 * @global string $comment_status
220229 */
221230 public function no_items () {
@@ -231,9 +240,13 @@ public function no_items() {
231240 }
232241
233242 /**
234- * @global int $post_id
243+ * Returns an array of comment status links.
244+ *
245+ * @global int $post_id
235246 * @global string $comment_status
236247 * @global string $comment_type
248+ *
249+ * @return array<string, string> Comment status HTML links keyed by view.
237250 */
238251 protected function get_views () {
239252 global $ post_id , $ comment_status , $ comment_type ;
@@ -354,9 +367,11 @@ protected function get_views() {
354367 }
355368
356369 /**
357- * @global string $comment_status
370+ * Gets the available bulk actions for the comments list.
371+ *
372+ * @global string $comment_status Current comment status filter.
358373 *
359- * @return array
374+ * @return array<string, string> Bulk action labels keyed by action name.
360375 */
361376 protected function get_bulk_actions () {
362377 global $ comment_status ;
@@ -395,10 +410,12 @@ protected function get_bulk_actions() {
395410 }
396411
397412 /**
413+ * Displays extra controls between bulk actions and pagination.
414+ *
398415 * @global string $comment_status
399416 * @global string $comment_type
400417 *
401- * @param string $which
418+ * @param string $which The location of the extra table nav markup: Either 'top' or 'bottom'.
402419 */
403420 protected function extra_tablenav ( $ which ) {
404421 global $ comment_status , $ comment_type ;
@@ -453,7 +470,9 @@ protected function extra_tablenav( $which ) {
453470 }
454471
455472 /**
456- * @return string|false
473+ * Gets the current action selected from the bulk actions dropdown.
474+ *
475+ * @return string|false Current action or false if none.
457476 */
458477 public function current_action () {
459478 if ( isset ( $ _REQUEST ['delete_all ' ] ) || isset ( $ _REQUEST ['delete_all2 ' ] ) ) {
@@ -464,6 +483,8 @@ public function current_action() {
464483 }
465484
466485 /**
486+ * Gets the list of columns.
487+ *
467488 * @global int $post_id
468489 *
469490 * @return string[] Array of column titles keyed by their column name.
@@ -547,7 +568,9 @@ protected function comment_type_dropdown( $comment_type ) {
547568 }
548569
549570 /**
550- * @return array
571+ * Gets a list of sortable columns.
572+ *
573+ * @return array<string, string|array> The sortable columns.
551574 */
552575 protected function get_sortable_columns () {
553576 return array (
@@ -638,10 +661,12 @@ public function display() {
638661 }
639662
640663 /**
664+ * Generates content for a single row of the table.
665+ *
641666 * @global WP_Post $post Global post object.
642667 * @global WP_Comment $comment Global comment object.
643668 *
644- * @param WP_Comment $item
669+ * @param WP_Comment $item The comment object.
645670 */
646671 public function single_row ( $ item ) {
647672 global $ post , $ comment ;
@@ -917,6 +942,8 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
917942 }
918943
919944 /**
945+ * Outputs the checkbox column.
946+ *
920947 * @since 5.9.0 Renamed `$comment` to `$item` to match parent class for PHP 8 named parameter support.
921948 *
922949 * @param WP_Comment $item The comment object.
@@ -941,6 +968,8 @@ public function column_cb( $item ) {
941968 }
942969
943970 /**
971+ * Outputs the comment column.
972+ *
944973 * @param WP_Comment $comment The comment object.
945974 */
946975 public function column_comment ( $ comment ) {
@@ -980,6 +1009,8 @@ public function column_comment( $comment ) {
9801009 }
9811010
9821011 /**
1012+ * Outputs the author column.
1013+ *
9831014 * @global string $comment_status
9841015 *
9851016 * @param WP_Comment $comment The comment object.
@@ -1039,6 +1070,8 @@ public function column_author( $comment ) {
10391070 }
10401071
10411072 /**
1073+ * Outputs the date column.
1074+ *
10421075 * @param WP_Comment $comment The comment object.
10431076 */
10441077 public function column_date ( $ comment ) {
@@ -1067,6 +1100,8 @@ public function column_date( $comment ) {
10671100 }
10681101
10691102 /**
1103+ * Outputs the response column.
1104+ *
10701105 * @param WP_Comment $comment The comment object.
10711106 */
10721107 public function column_response ( $ comment ) {
@@ -1113,6 +1148,8 @@ public function column_response( $comment ) {
11131148 }
11141149
11151150 /**
1151+ * Outputs the default column.
1152+ *
11161153 * @since 5.9.0 Renamed `$comment` to `$item` to match parent class for PHP 8 named parameter support.
11171154 *
11181155 * @param WP_Comment $item The comment object.
0 commit comments