Skip to content

Instantly share code, notes, and snippets.

@anttiviljami
Last active February 9, 2016 19:47
Show Gist options
  • Save anttiviljami/e6f453e5f988f125399d to your computer and use it in GitHub Desktop.
Save anttiviljami/e6f453e5f988f125399d to your computer and use it in GitHub Desktop.
Shadow Indicator
<?php
/**
* Plugin name: Shadow Indicator
* Author: Antti Kuosmanen / Seravo Oy
* Version: 1.0
*
* Show the user which environment we're in at all times
*/
add_action('wp_head', '_indicate_environment');
add_action('admin_notices', '_indicate_environment');
function _indicate_environment() {
if( getenv('WP_ENV') && getenv('WP_ENV') != 'production') {
?>
<div class="notice updated">
<p><strong>Current environment is <?php echo getenv('WP_ENV'); ?></strong>. Please note that you will not see any message while in production so please make sure to always double check your environment!
</div>
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment