WordPress.org

Forums

Constants ,define , wp-config and Multisite (2 posts)

  1. krembo99
    Member
    Posted 2 years ago #

    WordPress is now making quite an extensive use of constants (like AUTOSAVE_INTERVAL , WP_POST_REVISIONS or EMPTY_TRASH_DAYS ) that are configured in wp-config.php in the form of define('EMPTY_TRASH_DAYS', 1 ); .

    But is it possible to use different settings for different blogs ?
    If I want for example my main blog to empty trash every 3 days , but all the others every 5 , or if I want to enable Debug Mode only on a specific blog . what are my options ?

  2. It's not really designed to do that but in theory you should be able to. Most of the wp-config.php constants have to be defined before wp-settings.php is loaded because if not they will be defined very early in the load process. Depending on how your server is set up you could probably use the $_SERVER superglobal to do a conditional check. Maybe something like:

    **This might not work if your using subdomains or folders and probably only if your using domain mapping.

    if ( 'example-blog.com' == $_SERVER['HTTP_HOST'] )
          define( 'WP_DEBUG', true );
    
    ect...

Topic Closed

This topic has been closed to new replies.

About this Topic