diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 4cc5729353..b0631ff28b 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -556,13 +556,12 @@ function wp_dashboard_recent_drafts( $drafts = false ) { function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { $GLOBALS['comment'] =& $comment; - $comment_post_title = _draft_or_post_title( $comment->comment_post_ID ); - - if ( current_user_can( 'edit_post', $comment->comment_post_ID ) ) { + if ( $comment->comment_post_ID > 0 && current_user_can( 'edit_post', $comment->comment_post_ID ) ) { + $comment_post_title = _draft_or_post_title( $comment->comment_post_ID ); $comment_post_url = get_edit_post_link( $comment->comment_post_ID ); $comment_post_link = "$comment_post_title"; } else { - $comment_post_link = $comment_post_title; + $comment_post_link = ''; } $actions_string = ''; @@ -599,7 +598,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { } if ( '1' === $comment->comment_approved ) { - $actions['view'] = '' . _x( 'View', 'verb' ) . ''; + $actions['view'] = '' . _x( 'View', 'verb' ) . ''; } /** @@ -630,7 +629,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { ?> -
- ' . get_comment_author_link() . '', $comment_post_link, ' ' . __( '[Pending]' ) . '' ); ?> + ' . get_comment_author_link( $comment ) . '', + $comment_post_link, + ' ' . __( '[Pending]' ) . '' + ); + } else { + printf( + /* translators: 1: comment author, 2: notification if the comment is pending */ + __( 'From %1$s %2$s' ), + '' . get_comment_author_link( $comment ) . '', + ' ' . __( '[Pending]' ) . '' + ); + } + ?>
$type", $comment_post_link ); ?>
- + - +