[wp-hackers] Moving wp-settings.php out of wp-config.php

Mark Jaquith mark.wordpress at txfx.net
Mon Aug 21 06:20:38 GMT 2006


On Aug 20, 2006, at 9:21 AM, Sean Hickey wrote:

> The fix is simply adding the line
> require_once(ABSPATH.'wp-settings.php'); below the require_once(
> dirname(__FILE__) . '/wp-config.php'); in the wp-blog-header.php
> script.  Then the wp-config.php can act exactly as it should -- as the
> script that holds the DB connection information.
>
> Not wanting to break any existing plugins, the wp-config.php script
> could check for a defined constant, and if that constant is TRUE, it
> skips the inclusion of the wp-settings.php.  That way all old plugins
> still work, but new plugins can use wp-config.php the way it was meant
> to be used.  I could do something like:
>
> define('CONFIG_NOLOAD', true);
> include('wp-config.php');

This works for me, as nothing needs to change for plugin or WP-tie-in  
uses.  If you think there is a need for 3rd party scripts to load the  
DB info and constants, but not WP's core functions, then this would  
be a good way to do it.  Since this is such a small thing (4 or 5  
line patch), you should probably just go ahead and code it up for all  
to see on Trac.

--
Mark Jaquith
http://txfx.net/




More information about the wp-hackers mailing list