From 09df5b81a1f66cf504463b9b1ee0929052b0b20f Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 10 Sep 2015 17:48:34 +0000 Subject: [PATCH] Add a "View" row action for approved comments on the Dashboard screen, remove the link labeled `#`. Props rachelbaker, zeo. Fixes #18885. git-svn-id: https://develop.svn.wordpress.org/trunk@34006 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/dashboard.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index c9eb07c2e6..4cc5729353 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -565,8 +565,6 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { $comment_post_link = $comment_post_title; } - $comment_link = '#'; - $actions_string = ''; if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) { // Pre-order it: Approve | Reply | Edit | Spam | Trash. @@ -575,7 +573,8 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { 'reply' => '', 'edit' => '', 'spam' => '', - 'trash' => '', 'delete' => '' + 'trash' => '', 'delete' => '', + 'view' => '', ); $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) ); @@ -592,10 +591,16 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { $actions['edit'] = "". __('Edit') . ''; $actions['reply'] = '' . __('Reply') . ''; $actions['spam'] = "" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . ''; - if ( !EMPTY_TRASH_DAYS ) + + if ( ! EMPTY_TRASH_DAYS ) { $actions['delete'] = "" . __('Delete Permanently') . ''; - else + } else { $actions['trash'] = "" . _x('Trash', 'verb') . ''; + } + + if ( '1' === $comment->comment_approved ) { + $actions['view'] = '' . _x( 'View', 'verb' ) . ''; + } /** * Filter the action links displayed for each comment in the 'Recent Comments' @@ -634,7 +639,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {

' . get_comment_author_link() . '', $comment_post_link.' '.$comment_link, ' ' . __( '[Pending]' ) . '' ); ?> + '' . get_comment_author_link() . '', $comment_post_link, ' ' . __( '[Pending]' ) . '' ); ?>

-

$type", $comment_post_link." ".$comment_link ); ?>

+

$type", $comment_post_link ); ?>