Last active
April 4, 2020 15:33
-
-
Save cliffordp/6250869 to your computer and use it in GitHub Desktop.
wp-config.php conditional for WP Engine Staging Sites
*** Must be placed *after* the 'DOMAIN_CURRENT_SITE' constant is defined (near the bottom of wp-config.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
<?php | |
# WP Engine Staging Sites Rules | |
### Must be placed *after* the 'DOMAIN_CURRENT_SITE' (for Multisite) or 'WP_SITEURL' (for non-Multisite) constant is defined (near the bottom of Production Server's wp-config.php) | |
//Multisite | |
if( defined('DOMAIN_CURRENT_SITE') && preg_match('/.staging.wpengine.com$/', constant('DOMAIN_CURRENT_SITE')) ) { | |
//Non-Multisite | |
//if( defined('WP_SITEURL') && preg_match('/.staging.wpengine.com$/', constant('WP_SITEURL')) ) { | |
### Enter wp-config.php constants here... | |
# Turn on WP_DEBUG | |
define('WP_DEBUG', true); | |
} | |
# End of Staging Site Rules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment