Skip to content

Instantly share code, notes, and snippets.

@jamesmorrison
Created February 20, 2015 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmorrison/b011be64097a80899bde to your computer and use it in GitHub Desktop.
Save jamesmorrison/b011be64097a80899bde to your computer and use it in GitHub Desktop.
<?php
/*-------------------------------------------------------------------------------------------------------------------------
WordPress Config Master
-------------------------------------------------------------------------------------------------------------------------*/
// PHP Info
if ( isset($_GET['phpinfo']) ) {
phpinfo();
return;
}
// Protocol Check
if ( !empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) {
$protocol = 'https://';
} else {
$protocol = 'http://';
}
// Site Specific Name and Paths
define('WP_HOME', $protocol . $_SERVER['HTTP_HOST'] );
define('WP_SITEURL', WP_HOME . '/wp');
define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content' );
define('WP_CONTENT_URL', WP_HOME . '/wp-content');
define('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
define('WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins');
define('PLUGINDIR', WP_CONTENT_DIR . '/plugins' );
// Allow Theme / Plugin Updates
define('FS_METHOD', 'direct');
// Stop automated WP updates
define('WP_AUTO_UPDATE_CORE', false);
// Local DEV definition
define('LOCAL_DEV', true);
// Debugging
if ( isset($_GET['debug']) define('WP_DEBUG', true);
if ( !defined('WP_DEBUG') ) define('WP_DEBUG', false);
define('WP_DEBUG_LOG', true );
// Load local config file from the respective site
require_once($_SERVER['DOCUMENT_ROOT'] . '/wp-config-local.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment