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: https://develop.svn.wordpress.org/trunk@8188 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2008-06-24 19:58:54 +00:00
parent ed29b5321f
commit 91eeb5ff47
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();