From b5598e2bda1864eea3668acb542866d8b0965d8e Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 8 Jun 2007 06:56:34 +0000 Subject: [PATCH] More comment caching. see #4387 git-svn-id: http://svn.automattic.com/wordpress/trunk@5667 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/edit.php b/wp-admin/edit.php index f6301f6789..9bcaeec59e 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -150,6 +150,7 @@ 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) { + update_comment_cache($comments); ?>

    @@ -158,7 +159,8 @@ $i = 0; foreach ($comments as $comment) { ++$i; $class = ''; - $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); + $post = get_post($comment->comment_post_ID); + $authordata = get_userdata($post->post_author); $comment_status = wp_get_comment_status($comment->comment_ID); if ('unapproved' == $comment_status) $class .= ' unapproved';