diff --git a/src/wp-load.php b/src/wp-load.php index 9021ceb747..c022abcee5 100644 --- a/src/wp-load.php +++ b/src/wp-load.php @@ -23,6 +23,14 @@ define( 'ABSPATH', dirname(__FILE__) . '/' ); error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); +/* + * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php + * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit + * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a) + * and /blog/ is WordPress(b). + * + * If neither set of conditions is true, initiate loading the setup process. + */ if ( file_exists( ABSPATH . 'wp-config.php') ) { /** The config file resides in ABSPATH */