Make WordPress Core

Ticket #9458: 9458.diff

File 9458.diff, 1.3 KB (added by Denis-de-Bernardy, 17 years ago)
  • Users/denis/Sites/sem-pro/wp-includes/query.php

     
    23692369         */
    23702370        function the_post() {
    23712371                global $post;
    2372                 $this->in_the_loop = true;
     2372                global $wp_the_query;
     2373                if ( $this === $wp_the_query )
     2374                        $this->in_the_loop = true;
    23732375                $post = $this->next_post();
    23742376                setup_postdata($post);
    23752377
    2376                 if ( $this->current_post == 0 ) // loop has just started
     2378                if ( $this->current_post == 0 && $this === $wp_the_query ) // loop has just started
    23772379                        do_action('loop_start');
    23782380        }
    23792381
     
    23892391         * @return bool True if posts are available, false if end of loop.
    23902392         */
    23912393        function have_posts() {
     2394                global $wp_the_query;
    23922395                if ($this->current_post + 1 < $this->post_count) {
    23932396                        return true;
    23942397                } elseif ($this->current_post + 1 == $this->post_count && $this->post_count > 0) {
    2395                         do_action('loop_end');
     2398                        if ( $this === $wp_the_query )
     2399                                do_action('loop_end');
    23962400                        // Do some cleaning up after the loop
    23972401                        $this->rewind_posts();
    23982402                }
    23992403
    2400                 $this->in_the_loop = false;
     2404                if ( $this === $wp_the_query )
     2405                        $this->in_the_loop = false;
    24012406                return false;
    24022407        }
    24032408