Last active
February 9, 2016 19:47
-
-
Save anttiviljami/e6f453e5f988f125399d to your computer and use it in GitHub Desktop.
Shadow Indicator
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 | |
/** | |
* 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