Last active
August 29, 2015 13:58
-
-
Save andrezrv/10040561 to your computer and use it in GitHub Desktop.
Show info for current stage in admin toolbar.
This file contains hidden or 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 | |
/** | |
* Show info for current stage in admin toolbar. | |
*/ | |
function show_current_stage_info( $wp_admin_bar ) { | |
if ( defined( 'WP_STAGE' ) && WP_STAGE != '%%WP_STAGE%%' ) { | |
$args = array( | |
'id' => 'current-stage', | |
'title' => '<span class="dashicons dashicons-admin-site" style="font-family: \'dashicons\'; font-size: 20px; margin-right: 5px;"></span> Current stage: ' . WP_STAGE, | |
'meta' => array( 'class' => 'current-stage' ), | |
'parent' => 'top-secondary' | |
); | |
$wp_admin_bar->add_node( $args ); | |
} | |
} | |
add_action( 'admin_bar_menu', 'show_current_stage_info', 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment