Last active
December 15, 2015 23:09
-
-
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// [..] | |
/** | |
* 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