WordPress.org

Make WordPress Core

Ticket #6769: 6769.diff

File 6769.diff, 547 bytes (added by DD32, 7 years ago)
  • wp-includes/query.php

     
    15301530        function have_posts() { 
    15311531                if ($this->current_post + 1 < $this->post_count) { 
    15321532                        return true; 
    1533                 } elseif ($this->current_post + 1 == $this->post_count) { 
     1533                } elseif ($this->current_post + 1 == $this->post_count && $this->post_count > 0) { 
    15341534                        do_action('loop_end'); 
    15351535                        // Do some cleaning up after the loop 
    15361536                        $this->rewind_posts();