summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-includes/classes.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-18 09:16:34 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-18 09:16:34 +0000
commit3d22aa49e07b92dab07b1f9d6a8a66fb6ab20bdc (patch)
tree1bc483947163c7351f73b2c62a69ef774e021775 /wp-inst/wp-includes/classes.php
parent9d3f6c7b7452785bd585424238dd29f9d7369480 (diff)
downloadwordpress-mu-3d22aa49e07b92dab07b1f9d6a8a66fb6ab20bdc.tar.gz
wordpress-mu-3d22aa49e07b92dab07b1f9d6a8a66fb6ab20bdc.tar.xz
wordpress-mu-3d22aa49e07b92dab07b1f9d6a8a66fb6ab20bdc.zip
Merge from WP Core.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@31 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/classes.php')
-rw-r--r--wp-inst/wp-includes/classes.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/wp-inst/wp-includes/classes.php b/wp-inst/wp-includes/classes.php
index ca4c082..94f3e52 100644
--- a/wp-inst/wp-includes/classes.php
+++ b/wp-inst/wp-includes/classes.php
@@ -9,6 +9,7 @@ class WP_Query {
var $posts;
var $post_count = 0;
var $current_post = -1;
+ var $in_the_loop = false;
var $post;
var $is_single = false;
@@ -55,6 +56,7 @@ class WP_Query {
unset($this->queried_object_id);
$this->post_count = 0;
$this->current_post = -1;
+ $this->in_the_loop = false;
}
// Reparse the query vars.
@@ -593,6 +595,7 @@ class WP_Query {
function the_post() {
global $post;
+ $this->in_the_loop = true;
$post = $this->next_post();
setup_postdata($post);
}
@@ -600,8 +603,12 @@ class WP_Query {
function have_posts() {
if ($this->current_post + 1 < $this->post_count) {
return true;
+ } elseif ($this->current_post + 1 == $this->post_count) {
+ // Do some cleaning up after the loop
+ $this->rewind_posts();
}
+ $this->in_the_loop = false;
return false;
}