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: https://develop.svn.wordpress.org/trunk@1428 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
79695b45b5
commit
2ddf0582d4
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user