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
// Alert on Staging Site | |
// http://stackoverflow.com/questions/6522023/php-if-domain | |
$host = $_SERVER['HTTP_HOST']; | |
if ($host != 'XXXXXXXXXX.com') { | |
function staging_admin_error_notice() | |
{ | |
$class = "error"; | |
$message = "You are on the staging site."; | |
echo"<div class=\"$class\"> <h1>$message</h1></div>"; | |
} | |
add_action('admin_notices', 'staging_admin_error_notice'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment