diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 5a234857d8..ecd25a01b1 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -630,9 +630,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { $actions['trash'] = "" . _x( 'Trash', 'verb' ) . ''; } - if ( '1' === $comment->comment_approved ) { - $actions['view'] = '' . __( 'View' ) . ''; - } + $actions['view'] = '' . __( 'View' ) . ''; /** * Filter the action links displayed for each comment in the 'Recent Comments' @@ -653,9 +651,13 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | '; // Reply and quickedit need a hide-if-no-js span - if ( 'reply' == $action || 'quickedit' == $action ) + if ( 'reply' == $action || 'quickedit' == $action ) { $action .= ' hide-if-no-js'; + } + if ( 'view' === $action && '1' !== $comment->comment_approved ) { + $action .= ' hidden'; + } $actions_string .= "$sep$link"; } } diff --git a/src/wp-admin/js/edit-comments.js b/src/wp-admin/js/edit-comments.js index f201362bf0..e0f8a7c048 100644 --- a/src/wp-admin/js/edit-comments.js +++ b/src/wp-admin/js/edit-comments.js @@ -220,12 +220,15 @@ setCommentsList = function() { if ( settings.data.id == replyID ) replyButton.text(adminCommentsL10n.replyApprove); - c.find('div.comment_status').html('0'); + c.find( '.row-actions span.view' ).addClass( 'hidden' ).end() + .find( 'div.comment_status' ).html( '0' ); + } else { if ( settings.data.id == replyID ) replyButton.text(adminCommentsL10n.reply); - c.find('div.comment_status').html('1'); + c.find( '.row-actions span.view' ).removeClass( 'hidden' ).end() + .find( 'div.comment_status' ).html( '1' ); } diff = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;