diff --git a/src/wp-admin/comment.php b/src/wp-admin/comment.php
index 3f20c3cc2e..627006eefe 100644
a
|
b
|
if ( isset( $_GET['dt'] ) ) { |
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
| 39 | // Prevent actions on a comment associated with a trashed post. |
| 40 | $comment_id = absint( $_GET['c'] ); |
| 41 | $comment = get_comment( $comment_id ); |
| 42 | |
| 43 | if ( 'trash' === get_post_status( $comment->comment_post_ID ) ) { |
| 44 | wp_die( |
| 45 | __( 'You can’t edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' ) |
| 46 | ); |
| 47 | } |
| 48 | |
39 | 49 | switch ( $action ) { |
40 | 50 | |
41 | 51 | case 'editcomment': |
… |
… |
switch ( $action ) { |
60 | 70 | wp_enqueue_script( 'comment' ); |
61 | 71 | require_once ABSPATH . 'wp-admin/admin-header.php'; |
62 | 72 | |
63 | | $comment_id = absint( $_GET['c'] ); |
64 | | |
65 | | $comment = get_comment( $comment_id ); |
66 | 73 | if ( ! $comment ) { |
67 | 74 | comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'javascript:history.go(-1)' ) ); |
68 | 75 | } |
… |
… |
switch ( $action ) { |
87 | 94 | case 'spam': |
88 | 95 | $title = __( 'Moderate Comment' ); |
89 | 96 | |
90 | | $comment_id = absint( $_GET['c'] ); |
91 | | |
92 | | $comment = get_comment( $comment_id ); |
93 | 97 | if ( ! $comment ) { |
94 | 98 | wp_redirect( admin_url( 'edit-comments.php?error=1' ) ); |
95 | 99 | die(); |
diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css
index 3e55bb2d0e..d7c50535bb 100644
a
|
b
|
|
82 | 82 | border-right: 5px solid transparent; |
83 | 83 | } |
84 | 84 | |
85 | | .column-response .post-com-count-approved:hover .comment-count-approved, |
86 | | .column-response .post-com-count-approved:focus .comment-count-approved, |
87 | | .column-comments .post-com-count-approved:hover .comment-count-approved, |
88 | | .column-comments .post-com-count-approved:focus .comment-count-approved { |
| 85 | .column-response a.post-com-count-approved:hover .comment-count-approved, |
| 86 | .column-response a.post-com-count-approved:focus .comment-count-approved, |
| 87 | .column-comments a.post-com-count-approved:hover .comment-count-approved, |
| 88 | .column-comments a.post-com-count-approved:focus .comment-count-approved { |
89 | 89 | background: #0073aa; |
90 | 90 | } |
91 | 91 | |
92 | | .column-response .post-com-count-approved:hover:after, |
93 | | .column-response .post-com-count-approved:focus:after, |
94 | | .column-comments .post-com-count-approved:hover:after, |
95 | | .column-comments .post-com-count-approved:focus:after { |
| 92 | .column-response a.post-com-count-approved:hover:after, |
| 93 | .column-response a.post-com-count-approved:focus:after, |
| 94 | .column-comments a.post-com-count-approved:hover:after, |
| 95 | .column-comments a.post-com-count-approved:focus:after { |
96 | 96 | border-top-color: #0073aa; |
97 | 97 | } |
98 | 98 | |
diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php
index c423eebbca..ce23640270 100644
a
|
b
|
class WP_List_Table { |
682 | 682 | $pending_comments_number |
683 | 683 | ); |
684 | 684 | |
685 | | // No comments at all. |
686 | 685 | if ( ! $approved_comments && ! $pending_comments ) { |
| 686 | // No comments at all. |
687 | 687 | printf( |
688 | 688 | '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>', |
689 | 689 | __( 'No comments' ) |
690 | 690 | ); |
691 | | // Approved comments have different display depending on some conditions. |
| 691 | } elseif ( $approved_comments && 'trash' === get_post_status( $post_id ) ) { |
| 692 | // Don't link the comment bubble for a trashed post. |
| 693 | printf( |
| 694 | '<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>', |
| 695 | $approved_comments_number, |
| 696 | $pending_comments ? $approved_phrase : $approved_only_phrase |
| 697 | ); |
692 | 698 | } elseif ( $approved_comments ) { |
| 699 | // Link the comment bubble to approved comments. |
693 | 700 | printf( |
694 | 701 | '<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>', |
695 | 702 | esc_url( |
… |
… |
class WP_List_Table { |
705 | 712 | $pending_comments ? $approved_phrase : $approved_only_phrase |
706 | 713 | ); |
707 | 714 | } else { |
| 715 | // Don't link the comment bubble when there are no approved comments. |
708 | 716 | printf( |
709 | 717 | '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>', |
710 | 718 | $approved_comments_number, |