Utkarsh Dixit
2014-02-09 13:58:21 UTC
Hi,
I'm just a beginner to wordpress so it might sound a little naive, in
wp-config.php file we have following lines of code just before including
'wp-settings.php'
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
Seems useless to me as we already define ABSPATH in wp-blog-header.php and
suppose if we directly open our wp-config.php file then also if it is a
level above the wordpress root directory the ABSPATH is set to the
directory a level above the wordpress root directory which gives a fatal
error when we include the wp-settings.php file in the next step.Can't we do
it like this?
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
if(file_exists(ABSPATH . 'wp-settings.php'))
require_once(ABSPATH . 'wp-settings.php');
It helps in removing the Fatal error which might occur.
I'm just a beginner to wordpress so it might sound a little naive, in
wp-config.php file we have following lines of code just before including
'wp-settings.php'
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
Seems useless to me as we already define ABSPATH in wp-blog-header.php and
suppose if we directly open our wp-config.php file then also if it is a
level above the wordpress root directory the ABSPATH is set to the
directory a level above the wordpress root directory which gives a fatal
error when we include the wp-settings.php file in the next step.Can't we do
it like this?
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
if(file_exists(ABSPATH . 'wp-settings.php'))
require_once(ABSPATH . 'wp-settings.php');
It helps in removing the Fatal error which might occur.