[wp-hackers] Any way to bypass $wp->query_posts()?

Mike Schinkel mikeschinkel at newclarity.net
Mon Apr 6 00:28:10 GMT 2009


Hi all: 


I hope what I'm about to ask isn't viewed as heresy, but I've been building a CustomUrls plugin and am finding that AFAICT WordPress always runs a query for posts no matter if its needed or not, i.e. here is $wp->main() : 

function main($query_args = '') { 
$this->init(); 
$this->parse_request($query_args); 
$this->send_headers(); 
$this->query_posts(); 
$this->handle_404(); 
$this->register_globals(); 
do_action_ref_array('wp', array(&$this)); 
} 

I would like to be able to disable $wp->query_posts() in cases where I want to run a custom query. Is there a way to do this that I'm just not seeing, or if not is there a reason why it wouldn't make sense to allow bypassing or $wp->query_posts() somehow (and $wp->handle_404() too, for that matter)? 

-Mike Schinkel 
Custom Wordpress Plugins 
http://mikeschinkel.com/custom-wordpress-plugins 


More information about the wp-hackers mailing list