Ticket #10886: lighter-load.2.patch

File lighter-load.2.patch, 739 bytes (added by sivel, 4 years ago)

New patch that replaces the constant with a filter, and skips wp() as well.

  • wp-includes/classes.php

     
    487487         */ 
    488488        function main($query_args = '') { 
    489489                $this->init(); 
    490                 $this->parse_request($query_args); 
    491                 $this->send_headers(); 
    492                 $this->query_posts(); 
    493                 $this->handle_404(); 
    494                 $this->register_globals(); 
    495                 do_action_ref_array('wp', array(&$this)); 
     490 
     491                if ( apply_filters('run_queries', true, $query_args) === true ) { 
     492                        $this->parse_request($query_args); 
     493                        $this->send_headers(); 
     494                        $this->query_posts(); 
     495                        $this->handle_404(); 
     496                        $this->register_globals(); 
     497                        do_action_ref_array('wp', array(&$this)); 
     498                } 
    496499        } 
    497500 
    498501        /**