﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
17245	WordPress fails to load if wp-load.php is not called from the global scope	dave1010		"WordPress assumes it is being loaded in the global scope. Although including WordPress from inside a function is a strange (and probably should be an unsupported) thing to do, PHPUnit's commandline runner does it and there are probably other reasons someone may want to do it.

See this [http://wordpress.org/support/topic/running-wordpress-tests-with-phpunit discussion] as an example.

To fix this, wp-settings.php needs assumed globals to be specifically defined as globals. E.g.

{{{
// assumed global:
$wp_the_query =& new WP_Query(); 
// changing to implied global:
$GLOBALS['wp_the_query'] =& new WP_Query();
}}}

This shouldn't affect anything else (unless I'm missing something) and it also makes it clearer that the variables are global.

Might a patch get applied if I were to submit one?"	defect (bug)	closed	normal		General	3.1	normal	duplicate		
