Skip to content

Instantly share code, notes, and snippets.

@andrezrv
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrezrv/10040561 to your computer and use it in GitHub Desktop.
Save andrezrv/10040561 to your computer and use it in GitHub Desktop.
Show info for current stage in admin toolbar.
<?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