diff --git a/src/wp-admin/comment.php b/src/wp-admin/comment.php
index ee7a514be4..bfdccd6adb 100644
a
|
b
|
if ( isset( $_GET['dt'] ) ) { |
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
| 39 | /** |
| 40 | * Prevent actions in a comment associated with `Trashed` post. |
| 41 | * |
| 42 | * @since 5.3.0 |
| 43 | * |
| 44 | * @link https://core.trac.wordpress.org/ticket/37826 |
| 45 | */ |
| 46 | $comment_id = absint( $_GET['c'] ); |
| 47 | $comment = get_comment( $comment_id ); |
| 48 | |
| 49 | if ( 'trash' === get_post_status( $comment->comment_post_ID ) ) { |
| 50 | wp_die( __( 'You can’t edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' ) ); |
| 51 | } |
| 52 | |
39 | 53 | switch ( $action ) { |
40 | 54 | |
41 | 55 | case 'editcomment': |
… |
… |
switch ( $action ) { |
60 | 74 | wp_enqueue_script( 'comment' ); |
61 | 75 | require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
62 | 76 | |
63 | | $comment_id = absint( $_GET['c'] ); |
64 | | |
65 | | $comment = get_comment( $comment_id ); |
66 | 77 | if ( ! $comment ) { |
67 | 78 | comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'javascript:history.go(-1)' ) ); |
68 | 79 | } |
… |
… |
switch ( $action ) { |
87 | 98 | case 'spam': |
88 | 99 | $title = __( 'Moderate Comment' ); |
89 | 100 | |
90 | | $comment_id = absint( $_GET['c'] ); |
91 | | |
92 | | $comment = get_comment( $comment_id ); |
93 | 101 | if ( ! $comment ) { |
94 | 102 | wp_redirect( admin_url( 'edit-comments.php?error=1' ) ); |
95 | 103 | die(); |
diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php
index 3faaec691d..7c44e56e38 100644
a
|
b
|
class WP_List_Table { |
680 | 680 | ); |
681 | 681 | |
682 | 682 | // No comments at all. |
683 | | if ( ! $approved_comments && ! $pending_comments ) { |
| 683 | if (! $approved_comments && ! $pending_comments) { |
684 | 684 | printf( |
685 | 685 | '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>', |
686 | | __( 'No comments' ) |
| 686 | __('No comments') |
687 | 687 | ); |
688 | | // Approved comments have different display depending on some conditions. |
| 688 | /** |
| 689 | * Remove link in the comment bubble for 'trash' post. |
| 690 | * |
| 691 | * @since 5.4.0 |
| 692 | * |
| 693 | * @link https://core.trac.wordpress.org/ticket/37826 |
| 694 | */ |
| 695 | } elseif ( $approved_comments && 'trash' === get_post_status( $post_id ) ) { |
| 696 | printf( '<span class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>', |
| 697 | $approved_comments_number, |
| 698 | $pending_comments ? $approved_phrase : $approved_only_phrase |
| 699 | ); |
| 700 | // Approved comments have different display depending on some conditions. |
689 | 701 | } elseif ( $approved_comments ) { |
690 | 702 | printf( |
691 | 703 | '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>', |