Make WordPress Core

Ticket #16545: 16545.2.diff

File 16545.2.diff, 1.4 KB (added by ryan, 14 years ago)

Without parsed_query flag

  • wp-includes/query.php

     
    13121312         * @access public
    13131313         */
    13141314        function parse_query_vars() {
    1315                 $this->parse_query('');
     1315                $this->parse_query();
    13161316        }
    13171317
    13181318        /**
     
    13831383         * @since 1.5.0
    13841384         * @access public
    13851385         *
    1386          * @param string|array $query
     1386         * @param string|array $query Optional query.
    13871387         */
    1388         function parse_query($query) {
    1389                 if ( !empty($query) || !isset($this->query) ) {
     1388        function parse_query( $query =  '' ) {
     1389                if ( ! empty( $query ) ) {
    13901390                        $this->init();
    1391                         $this->query = $this->query_vars = wp_parse_args($query);
     1391                        $this->query = $this->query_vars = wp_parse_args( $query );
     1392                } elseif ( ! isset( $this->query ) ) {
     1393                        $this->query = $this->query_vars;
    13921394                }
    13931395
    13941396                $this->query_vars = $this->fill_query_vars($this->query_vars);
     
    18711873        function &get_posts() {
    18721874                global $wpdb, $user_ID, $_wp_using_ext_object_cache;
    18731875
     1876                $this->parse_query();
     1877
    18741878                do_action_ref_array('pre_get_posts', array(&$this));
    18751879
    18761880                // Shorthand.
     
    28512855         * @param string $query URL query string.
    28522856         * @return array List of posts.
    28532857         */
    2854         function &query($query) {
    2855                 $this->parse_query($query);
     2858        function &query( $query ) {
     2859                $this->init();
     2860                $this->query = $this->query_vars = wp_parse_args( $query );
    28562861                return $this->get_posts();
    28572862        }
    28582863