Skip to content

Instantly share code, notes, and snippets.

@stracker-phil
Created October 24, 2015 16:38
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 stracker-phil/0b0b07789cdd494035e6 to your computer and use it in GitHub Desktop.
Save stracker-phil/0b0b07789cdd494035e6 to your computer and use it in GitHub Desktop.
WP - wp-config template
<?php
define( 'ENV', 'dev' ); // Default: 'dev'
// Environment-specific settings ----------------------------------------------
switch ( ENV ) {
case 'dev': // Default environment!
define( 'WPMUDEV_APIKEY', false );
break;
case 'member-a':
define( 'DB_NAME', 'temp_a' );
define( 'MULTISITE', false );
define( 'MS_STOP_EMAILS', true );
break;
case 'member-b':
define( 'DB_NAME', 'temp_b' );
define( 'MULTISITE', true );
define( 'MS_STOP_EMAILS', true );
$table_prefix = 'wp_fdwy8jp5q_';
break;
default:
die( 'Environment not defined in wp-config.php' );
}
// ----------------------------------------------------------------------------
// Following are the defaults for values not defined in the environment above.
// DB settings ----------------------------------------------------------------
defined( 'DB_NAME' ) || define( 'DB_NAME', 'wordpress_multisite' );
defined( 'DB_USER' ) || define( 'DB_USER', 'wp' );
defined( 'DB_PASSWORD' ) || define( 'DB_PASSWORD', 'wp' );
defined( 'DB_HOST' ) || define( 'DB_HOST', 'localhost' );
defined( 'DB_CHARSET' ) || define( 'DB_CHARSET', 'utf8' );
defined( 'DB_COLLATE' ) || define( 'DB_COLLATE', '' );
empty( $table_prefix ) && $table_prefix = 'wp_';
// ----------------------------------------------------------------------------
// Multisite details ----------------------------------------------------------
defined( 'MULTISITE' ) || define( 'MULTISITE', true );
defined( 'SUBDOMAIN_INSTALL' ) || define( 'SUBDOMAIN_INSTALL', false );
defined( 'DOMAIN_CURRENT_SITE' ) || define( 'DOMAIN_CURRENT_SITE', 'multisite.wordpress.dev' );
defined( 'PATH_CURRENT_SITE' ) || define( 'PATH_CURRENT_SITE', '/' );
defined( 'SITE_ID_CURRENT_SITE' ) || define( 'SITE_ID_CURRENT_SITE', 1 );
defined( 'BLOG_ID_CURRENT_SITE' ) || define( 'BLOG_ID_CURRENT_SITE', 1 );
// ----------------------------------------------------------------------------
// Security token -------------------------------------------------------------
define( 'AUTH_KEY', '...' ); // TODO: https://api.wordpress.org/secret-key/1.1/salt/
define( 'SECURE_AUTH_KEY', '...' );
define( 'LOGGED_IN_KEY', '...' );
define( 'NONCE_KEY', '...' );
define( 'AUTH_SALT', '...' );
define( 'SECURE_AUTH_SALT', '...' );
define( 'LOGGED_IN_SALT', '...' );
define( 'NONCE_SALT', '...' );
// ----------------------------------------------------------------------------
// Possible values: '', 'de_DE', etc. Format: <lang>_<country>
defined( 'WPLANG' ) || define( 'WPLANG', '' );
// ----------------------------------------------------------------------------
// All kinds of debugging options ---------------------------------------------
defined( 'WP_DEBUG_CORE' ) || define( 'WP_DEBUG_CORE', false );
defined( 'WP_DEBUG' ) || define( 'WP_DEBUG', true );
defined( 'WP_DEBUG_LOG' ) || define( 'WP_DEBUG_LOG', true );
defined( 'WP_DEBUG_DISPLAY' ) || define( 'WP_DEBUG_DISPLAY', true );
defined( 'SCRIPT_DEBUG' ) || define( 'SCRIPT_DEBUG', true );
defined( 'JETPACK_DEV_DEBUG' ) || define( 'JETPACK_DEV_DEBUG', true );
defined( 'WDEV_UNMINIFIED' ) || define( 'WDEV_UNMINIFIED', true );
defined( 'WDEV_DEBUG' ) || define( 'WDEV_DEBUG', true );
defined( 'WDEV_AJAX_DEBUG' ) || define( 'WDEV_AJAX_DEBUG', true );
// ----------------------------------------------------------------------------
// Plugin specific settings ---------------------------------------------------
# -- M2 ||
defined( 'MS_STOP_EMAILS' ) || define( 'MS_STOP_EMAILS', false );
defined( 'MS_LOCK_SUBSCRIPTIONS' ) || define( 'MS_LOCK_SUBSCRIPTIONS', false );
defined( 'MS_PROTECT_NETWORK' ) || define( 'MS_PROTECT_NETWORK', false );
defined( 'MS_ADMIN_CAPABILITY' ) || define( 'MS_ADMIN_CAPABILITY', false );
# -- Popup ||
defined( 'PO_GLOBAL' ) || define( 'PO_GLOBAL', false );
defined( 'POP_UP_TAXONOMY' ) || define( 'POP_UP_TAXONOMY', 'tag' );
# -- WPMUDEV Dashboard ||
defined( 'WPMUDEV_API_UNCOMPRESSED' ) || define( 'WPMUDEV_API_UNCOMPRESSED', true );
defined( 'WPMUDEV_APIKEY' ) || define( 'WPMUDEV_APIKEY', '...' ); // TODO: Insert your API key!
// ----------------------------------------------------------------------------
// Absolute path to the WordPress directory.
defined( 'ABSPATH' ) || define( 'ABSPATH', dirname( __FILE__ ) . '/' );
// Sets up WordPress vars and included files.
require_once ABSPATH . 'wp-settings.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment