Don't call loop_end hook if we don't have any posts. props Denis-de-Bernardy and DD32. fixes #6769 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@8188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-06-24 19:58:54 +00:00
parent 42a058e986
commit bf9f2f1cc7
1 changed files with 1 additions and 1 deletions

View File

@ -1530,7 +1530,7 @@ class WP_Query {
function have_posts() {
if ($this->current_post + 1 < $this->post_count) {
return true;
} elseif ($this->current_post + 1 == $this->post_count) {
} elseif ($this->current_post + 1 == $this->post_count && $this->post_count > 0) {
do_action('loop_end');
// Do some cleaning up after the loop
$this->rewind_posts();