WP Manifestindependent plugin directory
manifest / admin / admin-header-colour

ColourCue Admin Bar

A very simple WordPress plugin to set the colour of the admin bar based on the environment.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/d-meagher/admin-header-colour/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

ColourCue Admin Bar banner

A simple WordPress plugin that changes the admin bar background colour based on the active environment.

Features

  • Uses WordPress environment detection (wp_get_environment_type()).
  • Includes a simple settings page to pick custom colours per environment.
  • Automatically switches admin bar text for readable contrast (minimum 4.5:1 target).
  • Optional all-environment override.

Environment Setup

Set your environment in wp-config.php:

define( 'WP_ENVIRONMENT_TYPE', 'staging' );

Valid values are:

  • local
  • development
  • staging
  • production

If not set, WordPress defaults to production.

Settings Page

Go to Settings -> ColourCue Admin Bar and set:

  • Local colour
  • Development colour
  • Staging colour
  • Production colour

Each field has a colour picker and a hex input.

Optional Constant Override

You can force one colour for all environments:

define( 'CAB_FORCE_ADMIN_BAR_COLOR', '#222222' );

Filters

Filter default map:

add_filter( 'cab_environment_colour_map', function( $map ) {
    $map['staging'] = '#ff9900';
    return $map;
} );

Filter final resolved colour:

add_filter( 'cab_admin_bar_colour', function( $colour, $environment ) {
    if ( 'production' === $environment ) {
        return '#267f00';
    }
    return $colour;
}, 10, 2 );

Filter text colour after contrast check:

add_filter( 'cab_admin_bar_text_colour', function( $text_colour, $background_colour ) {
    return $text_colour;
}, 10, 2 );