diff --git src/wp-admin/includes/class-wp-comments-list-table.php src/wp-admin/includes/class-wp-comments-list-table.php
index 5803b1d..f70f467 100644
|
|
class WP_Comments_List_Table extends WP_List_Table { |
478 | 478 | |
479 | 479 | $actions['quickedit'] = sprintf( $format, $comment->comment_ID, $post->ID, 'edit', 'vim-q comment-inline', esc_attr__( 'Quick Edit' ), __( 'Quick Edit' ) ); |
480 | 480 | |
481 | | $actions['reply'] = sprintf( $format, $comment->comment_ID, $post->ID, 'replyto', 'vim-r comment-inline', esc_attr__( 'Reply to this comment' ), __( 'Reply' ) ); |
| 481 | $comment_depth = $this->get_comment_depth( $comment ); |
| 482 | $thread_comments = (bool)get_option( 'thread_comments' ); |
| 483 | $max_depth = (int)get_option( 'thread_comments_depth' ); |
| 484 | if ( ( $max_depth && $thread_comments ) && ( $comment_depth < $max_depth ) ) { |
| 485 | $actions['reply'] = sprintf( $format, $comment->comment_ID, $post->ID, 'replyto', 'vim-r comment-inline', esc_attr__( 'Reply to this comment' ), __( 'Reply' ) ); |
| 486 | } |
| 487 | |
482 | 488 | } |
483 | 489 | |
484 | 490 | /** This filter is documented in wp-admin/includes/dashboard.php */ |
… |
… |
class WP_Comments_List_Table extends WP_List_Table { |
506 | 512 | } |
507 | 513 | } |
508 | 514 | |
| 515 | public function get_comment_depth( $comment ) { |
| 516 | |
| 517 | if ( 0 == $comment->comment_parent ) { |
| 518 | return 1; |
| 519 | } |
| 520 | |
| 521 | while ( 0 != $comment->comment_parent ) { |
| 522 | $comment = get_comment( $comment->comment_parent ); |
| 523 | $depth++; |
| 524 | } |
| 525 | |
| 526 | return $depth; |
| 527 | } |
| 528 | |
509 | 529 | public function column_author( $comment ) { |
510 | 530 | global $comment_status; |
511 | 531 | |