Make WordPress Core

Ticket #16545: 16545-parsed_query-flag.diff

File 16545-parsed_query-flag.diff, 1.1 KB (added by markjaquith, 14 years ago)
  • wp-includes/query.php

     
    12401240        var $parsed_tax_query = false;
    12411241
    12421242        /**
     1243         * Whether the query has been parsed once.
     1244         *
     1245         * @since 3.1.0
     1246         * @access private
     1247         * @var bool
     1248         */
     1249        var $parsed_query = false;
     1250
     1251        /**
    12431252         * Resets query flags to false.
    12441253         *
    12451254         * The query flags are what page info WordPress was able to figure out.
     
    16251634                if ( '404' == $qv['error'] )
    16261635                        $this->set_404();
    16271636
     1637                // Mark the query as parsed
     1638                $this->parsed_query = true;
     1639
    16281640                if ( !empty($query) )
    16291641                        do_action_ref_array('parse_query', array(&$this));
    16301642        }
     
    18711883        function &get_posts() {
    18721884                global $wpdb, $user_ID, $_wp_using_ext_object_cache;
    18731885
     1886                // If we haven't parsed the query already, we should do that now
     1887                if ( !$this->parsed_query )
     1888                        $this->parse_query( $this->query );
     1889
     1890                $this->parsed_query = false; // Reset it
     1891
    18741892                do_action_ref_array('pre_get_posts', array(&$this));
    18751893
    18761894                // Shorthand.