From daadfe3ffd4f8243f89258e5f9c52a3351ecdc92 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 8 Jun 2007 06:56:34 +0000 Subject: [PATCH] More comment caching. see #4387 git-svn-id: https://develop.svn.wordpress.org/trunk@5667 602fd350-edb4-49c9-b593-d223f7449a82 --- 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';