From 069c6d1f17fa1fcabd0cc877c94cc14f75454ed6 Mon Sep 17 00:00:00 2001 From: rboren Date: Tue, 15 Jun 2004 03:30:00 +0000 Subject: [PATCH] Call update_post_caches() from within query_posts() and get_posts(). http://mosquito.wordpress.org/bug_view_page.php?bug_id=0000046 git-svn-id: http://svn.automattic.com/wordpress/trunk@1428 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-blog-header.php | 3 --- wp-includes/functions.php | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index b86866c639..5e6afd9ad1 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -153,9 +153,6 @@ update_category_cache(); // Call query posts to do the work. $posts = query_posts($query_string); -// Update per post caches. -update_post_caches($posts); - if (1 == count($posts)) { if ($p || $name) { $more = 1; diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2955c10884..38f62ec915 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1352,6 +1352,8 @@ function get_posts($args) { $now = current_time('mysql'); $posts = $wpdb->get_results("SELECT DISTINCT * FROM $wpdb->posts WHERE post_date <= '$now' AND (post_status = 'publish') GROUP BY $wpdb->posts.ID ORDER BY post_date DESC LIMIT " . $r['offset'] . ',' . $r['numberposts']); + + update_post_caches($posts); return $posts; } @@ -1704,7 +1706,9 @@ function query_posts($query) { // error_log("$request"); // echo $request; - return $wpdb->get_results($request); + $posts = $wpdb->get_results($request); + update_post_caches($posts); + return $posts; } function update_post_caches($posts) {