Skip to content

Instantly share code, notes, and snippets.

@mircobabini
Last active December 15, 2015 23:09
Show Gist options
  • Save mircobabini/5338566 to your computer and use it in GitHub Desktop.
Save mircobabini/5338566 to your computer and use it in GitHub Desktop.
Additions for wp-load.php Wordpress' loader. It enables hostname-specific Wordpress' configuration files (wp-config-HOSTNAME.php).
<?
// [..]
/**
* Hostname specific wp-config statement
*
* @author Mirco Babini <mirkolofio@gmail.com>
* @uses hostname (): */
if (!function_exists ('hostname')) {
function hostname () { return trim (php_uname ("n")); } } /*
*
* Place these lines before the first cond. statement in wp-load.php
*/
$hostname = hostname ();
if (file_exists (ABSPATH."wp-config-{$hostname}.php")) {
/** Hostname specific wp-config */
require_once (ABSPATH."wp-config-{$hostname}.php");
} else /* if (..) { .. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment