diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 41e706e66..23926fff0 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2065,6 +2065,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $comment = get_comment( $comment_id ); $post = get_post($comment->comment_post_ID); $the_comment_status = wp_get_comment_status($comment->comment_ID); + $user_can = current_user_can('edit_post', $post->ID); $author_url = get_comment_author_url(); if ( 'http://' == $author_url ) @@ -2102,7 +2103,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, case 'cb': if ( !$checkbox ) break; echo ''; - if ( current_user_can('edit_post', $post->ID) ) echo ""; + if ( $user_can ) echo ""; echo ''; break; case 'comment': @@ -2113,15 +2114,15 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, comment_text(); ?> ID) ) { + if ( $user_can ) { $actions['approve'] = "" . __( 'Approve' ) . ''; $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; if ( $comment_status ) { // not looking at all comments @@ -2164,7 +2165,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, echo ""; comment_author(); echo '
'; if ( !empty($author_url) ) echo "$author_url_display
"; - if ( current_user_can( 'edit_post', $post->ID ) ) { + if ( $user_can ) { if ( !empty($comment->comment_author_email) ) { comment_author_email_link(); echo '
'; @@ -2191,7 +2192,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $_comment_pending_count_temp = (array) get_pending_comments_num( array( $post->ID ) ); $pending_comments = $_comment_pending_count[$post->ID] = $_comment_pending_count_temp[$post->ID]; } - if ( current_user_can( 'edit_post', $post->ID ) ) { + if ( $user_can ) { $post_link = ""; $post_link .= get_the_title($post->ID) . ''; } else {