diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index dbb742bb40..c761e8c5a1 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -105,7 +105,6 @@ if ('view' == $mode) { echo "
    \n"; $i = 0; foreach ( $comments as $comment ) { - get_comment( $comment ); // Cache it _wp_comment_list_item( $comment->comment_ID, ++$i ); } echo "
\n\n"; diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 30bc4b61cb..06ab9caf29 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -131,48 +131,21 @@ if ( 1 == count($posts) ) { $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); if ($comments) { + // Make sure comments, post, and post_author are cached update_comment_cache($comments); + $post = get_post($id); + $authordata = get_userdata($post->post_author); ?>

-
    +
      comment_post_ID); - $authordata = get_userdata($post->post_author); - $comment_status = wp_get_comment_status($comment->comment_ID); - if ('unapproved' == $comment_status) - $class .= ' unapproved'; - if ($i % 2) - $class .= ' alternate'; - echo "
    1. "; -?> -

      comment_author_email) { ?>| comment_author_url && 'http://' != $comment->comment_author_url) { ?> | |

      - - - -

      — [ -comment_post_ID) ) { - echo " " . __('Edit') . ''; - echo ' | comment_author)) . "', theCommentList );\">" . __('Delete') . ' '; - if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { - echo ' | ' . __('Unapprove') . ' '; - echo ' | ' . __('Approve') . ' '; - } - echo " | comment_post_ID . "&c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . " "; -} -?> ] -

      -
    2. - -comment_ID, ++$i ); + } echo '
    '; - }//end if comments - ?> + } // end if comments +?> diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index c8c09c0061..bb2c6446ed 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -318,11 +318,14 @@ if ( current_user_can('edit_post', $comment->comment_post_ID) ) { $url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$id", "delete-comment_$id" ) ); echo " | " . __('Spam') . ' '; } -$post = get_post($comment->comment_post_ID, OBJECT, 'display'); -$post_title = wp_specialchars( $post->post_title, 'double' ); -$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; +if ( !is_single() ) { + $post = get_post($comment->comment_post_ID, OBJECT, 'display'); + $post_title = wp_specialchars( $post->post_title, 'double' ); + $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; ?> - ] —

    + ] — + +