Make WordPress Core

Ticket #10886: 10886.7.diff

File 10886.7.diff, 1.5 KB (added by wonderboymusic, 9 years ago)
  • src/wp-includes/class-wp.php

     
    118118         * @global WP_Rewrite $wp_rewrite
    119119         *
    120120         * @param array|string $extra_query_vars Set the extra query variables.
     121         * @return bool Whether the request was parsed.
    121122         */
    122123        public function parse_request($extra_query_vars = '') {
    123124                global $wp_rewrite;
     
    131132                 * @param WP           $this             Current WordPress environment instance.
    132133                 * @param array|string $extra_query_vars Extra passed query variables.
    133134                 */
    134                 if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) )
    135                         return;
     135                if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) ) {
     136                        return false;
     137                }
    136138
    137139                $this->query_vars = array();
    138140                $post_type_query_vars = array();
     
    246248
    247249                                $this->did_permalink = false;
    248250                        }
     251
     252                        return true;
    249253                }
    250254
    251255                /**
     
    624628         */
    625629        public function main($query_args = '') {
    626630                $this->init();
    627                 $this->parse_request($query_args);
     631               
     632                $parsed = $this->parse_request( $query_args );
     633
    628634                $this->send_headers();
    629                 $this->query_posts();
    630                 $this->handle_404();
    631                 $this->register_globals();
    632635
     636                if ( $parsed ) {
     637                        $this->query_posts();
     638                        $this->handle_404();
     639                        $this->register_globals();
     640                }
     641
    633642                /**
    634643                 * Fires once the WordPress environment has been set up.
    635644                 *