From a7f441525e5011a104353f8ecfd18bdda8e1ddfd Mon Sep 17 00:00:00 2001 From: westi Date: Sat, 15 Mar 2008 22:09:23 +0000 Subject: [PATCH] Only show IP and email address for comments a user can edit. Fixes #4353. git-svn-id: http://svn.automattic.com/wordpress/trunk@7322 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 23fbd819af..8a6ef3e251 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -606,6 +606,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true $authordata = get_userdata($post->post_author); $the_comment_status = wp_get_comment_status($comment->comment_ID); $class = ('unapproved' == $the_comment_status) ? 'unapproved' : ''; + if ( current_user_can( 'edit_post', $post->ID ) ) { if ( 'attachment' == $post->post_type ) $post_link = ""; @@ -613,15 +614,23 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true $post_link = ""; else $post_link = ""; - } - $post_link .= get_the_title($comment->comment_post_ID) . ''; + $post_link .= get_the_title($comment->comment_post_ID) . ''; + + $edit_link_start = ""; + $edit_link_end = ''; + } else { + $post_link = get_the_title($comment->comment_post_ID); + $edit_link_start = $edit_link_end =''; + } + $author_url = get_comment_author_url(); if ( 'http://' == $author_url ) $author_url = ''; $author_url_display = $author_url; if ( strlen($author_url_display) > 50 ) $author_url_display = substr($author_url_display, 0, 49) . '...'; + $ptime = date('G', strtotime( $comment->comment_date ) ); if ( ( abs(time() - $ptime) ) < 86400 ) $ptime = sprintf( __('%s ago'), human_time_diff( $ptime ) ); @@ -639,14 +648,16 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true comment_post_ID) ) { ?> -


+


| + ID ) ) : ?> comment_author_email) ): ?> | +