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
This commit is contained in:
rboren 2004-06-15 03:30:00 +00:00
parent 314209054d
commit 069c6d1f17
2 changed files with 5 additions and 4 deletions

View File

@ -153,9 +153,6 @@ update_category_cache();
// Call query posts to do the work. // Call query posts to do the work.
$posts = query_posts($query_string); $posts = query_posts($query_string);
// Update per post caches.
update_post_caches($posts);
if (1 == count($posts)) { if (1 == count($posts)) {
if ($p || $name) { if ($p || $name) {
$more = 1; $more = 1;

View File

@ -1353,6 +1353,8 @@ function get_posts($args) {
$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']); $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; return $posts;
} }
@ -1704,7 +1706,9 @@ function query_posts($query) {
// error_log("$request"); // error_log("$request");
// echo $request; // echo $request;
return $wpdb->get_results($request); $posts = $wpdb->get_results($request);
update_post_caches($posts);
return $posts;
} }
function update_post_caches($posts) { function update_post_caches($posts) {