Skip to content

Instantly share code, notes, and snippets.

Last active February 16, 2018 21:50
What would you like to do?
// Alert on Staging Site
$host = $_SERVER['HTTP_HOST'];
if ($host != '') {
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