1

In 4.0 wp-config-sample.php contains

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

but ABSPATH is defined in wp-load.php before including wp-config.php

/** Define ABSPATH as this file's directory */
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 ( file_exists( ABSPATH . 'wp-config.php') ) {

    /** The config file resides in ABSPATH */
    require_once( ABSPATH . 'wp-config.php' );

I assume wp-config-sample.php is out of sync with the actual code, but did I miss something and there is some other way to override ABSPATH?

1

The official reply is that ABSPATH is more for backward compatibility with code which was written when plugins were including wp-config.php and overriding WP_CONTENT_DIR should be enough.

https://core.trac.wordpress.org/ticket/29626#comment:3

https://core.trac.wordpress.org/ticket/26592#comment:8

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.