Title: Contextual Adminbar Color
Author: Jb Audras
Published: <strong>2019 年 11 月 25 日</strong>
Last modified: 2025 年 11 月 27 日

---

搜索插件

![](https://ps.w.org/contextual-adminbar-color/assets/banner-772x250.png?rev=2201208)

![](https://ps.w.org/contextual-adminbar-color/assets/icon-256x256.png?rev=2201208)

# Contextual Adminbar Color

 作者：[Jb Audras](https://profiles.wordpress.org/audrasjb/)

[下载](https://downloads.wordpress.org/plugin/contextual-adminbar-color.0.3.1.zip)

 * [详情](https://cn.wordpress.org/plugins/contextual-adminbar-color/#description)
 * [评价](https://cn.wordpress.org/plugins/contextual-adminbar-color/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/contextual-adminbar-color/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/contextual-adminbar-color/#developers)

 [支持](https://wordpress.org/support/plugin/contextual-adminbar-color/)

## 描述

This plugins provides custom admin bar colors to differentiate environments (staging,
preprod, production). It’s really **easy to use** and **developer-friendly**.

The plugin provides a settings screen which several options:

 * choose between several color predefined schemes.
 * use a favicon to better differentiate your environments in your browser’s tabs.
 * add a custom message in your admin bar, like “Production website”, “staging version”
   or whatever your want.
 * choose the user roles that will see the color scheme (other roles will see the
   default admin bar).

It also offers few PHP constants you can use in your `wp-config.php` file (see Frequently
Asked Questions below).

Since WordPress Core will probably deprecate alternate admin color schemes in mid-
term, this plugin is meant to be use by those who rely on colors to know is they
are in staging, preproduction or production environment.

Last but not least, all provided color schemes are accessibility-ready!

## 屏幕截图

[⌊Plugin settings screen.⌉⌊Plugin settings screen.⌉[

Plugin settings screen.

[⌊Use favicons to differentiate your browser tabs.⌉⌊Use favicons to differentiate
your browser tabs.⌉[

Use favicons to differentiate your browser tabs.

[⌊Front-end rendering.⌉⌊Front-end rendering.⌉[

Front-end rendering.

## 安装

 1. Activate the plugin.
 2. Good to Tools > Adminbar settings to configure the plugin.
 3. Save your changes and enjoy 🙂

## 常见问题

### How to use the PHP constant in wp-config.php?

Use `CONTEXTUAL_ADMINBAR_COLOR` to force color scheme.
 Accepted values: `blue`,`
red`, `green`, `purple`, `orange` and `darkgray`. Example: `define( 'CONTEXTUAL_ADMINBAR_COLOR','
purple' );`

Use `CONTEXTUAL_ADMINBAR_MESSAGE` to force your custom admin bar message to display.

Accepted values: any valid string. Example: `define( 'CONTEXTUAL_ADMINBAR_MESSAGE','
This is the staging website' );`

 * `CONTEXTUAL_ADMINBAR_FAVICON` to force a favicon.
    Accepted values: `0` (don’t
   force a color based favicon) or `1` (force WordPress Admin to use the favicon
   that is related to your selected color scheme). Example: `define( 'CONTEXTUAL_ADMINBAR_FAVICON',
   1 );`
 * `CONTEXTUAL_ADMINBAR_SETTINGS` to remove the settings screen from WordPress Admin,
   and manage the plugin’s settings only within the `wp-config.php` file.
    Accepted
   values: `0` (remove the settings screen) or `1` (keep it). Example: `define( '
   CONTEXTUAL_ADMINBAR_SETTINGS', 0 )`

## 评价

![](https://secure.gravatar.com/avatar/233d778d8aa6296afee9174e88034408e4d30655e0b437748825b5e030e65e1c?
s=60&d=retro&r=g)

### 󠀁[Très pratique !](https://wordpress.org/support/topic/tres-pratique-78/)󠁿

 [Jean-BriceM](https://profiles.wordpress.org/jean-bricem/) 2025 年 1 月 8 日

Présent sur toutes mes sites en pre-prod ! 🙂

![](https://secure.gravatar.com/avatar/34f6c789ee6d7cb85d1642d91d7fbe62532b8089872214a8a60c8e00b001f17a?
s=60&d=retro&r=g)

### 󠀁[highly useful](https://wordpress.org/support/topic/highly-useful-10/)󠁿

 [omeld](https://profiles.wordpress.org/omeld/) 2022 年 9 月 14 日

and unobtrusive

![](https://secure.gravatar.com/avatar/aa1577ab2b2325af74f2bae3ba9662b306a7450d9ab89b4c64686dcdad8e5472?
s=60&d=retro&r=g)

### 󠀁[Just what I needed](https://wordpress.org/support/topic/just-what-i-needed-1133/)󠁿

 [evaldash](https://profiles.wordpress.org/evaldash/) 2021 年 9 月 3 日

Works as expected, would be great if compatibility with recent Wordpress versions
were checked, since it’s a really useful and simple plugin. Thanks!

![](https://secure.gravatar.com/avatar/d69da20f14fa214c641c199d6ea0e140fa03567ca58cf4429eda37b6394f7511?
s=60&d=retro&r=g)

### 󠀁[Exactly what I was looking for](https://wordpress.org/support/topic/exactly-what-i-was-looking-for-488/)󠁿

 [martinjosef](https://profiles.wordpress.org/martinjosef/) 2021 年 2 月 5 日

This is so much appreciated, I built my own very bad version of this and ran with
it for years. It works exactly as I hoped it would. Thanks!

![](https://secure.gravatar.com/avatar/0049c2e599fd19e1ba5c5e752c713f79b4bae3ddd883a2b38987d1213f21c3a4?
s=60&d=retro&r=g)

### 󠀁[Makes my life much better knowing exactly where I am](https://wordpress.org/support/topic/makes-my-life-much-better-knowing-exactly-where-i-am/)󠁿

 [Dirk Tornow](https://profiles.wordpress.org/smings/) 2021 年 1 月 23 日

Such a great helper! It gives me the safety to know exactly which environment I 
work on without having to worry. Sometimes things look just alike in your DEV, STAGE
and PROD environment. And with this little plugin, it is immediately obvious which
environment you work in. And it also works on WP 5.6 – just checked…

![](https://secure.gravatar.com/avatar/ec6a49f01b047a37da956a20ebc3f4097c99fc4f559c9be8fecce6b38a758acd?
s=60&d=retro&r=g)

### 󠀁[Simple and very usefull!](https://wordpress.org/support/topic/simple-and-very-usefull-5/)󠁿

 [Pedro Mendonça](https://profiles.wordpress.org/pedromendonca/) 2020 年 2 月 5 
日

Really enjoy this plugin. It’s simple and well integrated with WordPress admin UI.
I really like the optional configuration through wp-config.php. After configuring
it once in wp-config.php, I won’t ever need to reconfigure because it doesn’t loose
settings on importing settings (eg. staging <-> production). Great job @audrasjb!

 [ 阅读所有8条评价 ](https://wordpress.org/support/plugin/contextual-adminbar-color/reviews/)

## 贡献者及开发者

「Contextual Adminbar Color」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Jb Audras ](https://profiles.wordpress.org/audrasjb/)
 *   [ Whodunit ](https://profiles.wordpress.org/whodunitagency/)

「Contextual Adminbar Color」插件已被翻译至 2 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/contextual-adminbar-color/contributors)
为本插件所做的贡献。

[帮助将「Contextual Adminbar Color」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/contextual-adminbar-color)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/contextual-adminbar-color/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/contextual-adminbar-color/)，或通过
[RSS](https://plugins.trac.wordpress.org/log/contextual-adminbar-color/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/contextual-adminbar-color/)。

## 更新日志

#### 0.3.1

 * Adds option to switch back to default color scheme.

#### 0.3

 * Fixes security issues, thanks to the WordPress Plugin/Security team.

#### 0.2

 * Plugin initial version, now on WordPress.org!

#### 0.1

 * Plugin initial version, only released on GitHub.

## 额外信息

 *  版本 **0.3.1**
 *  最后更新：**7 月前**
 *  活跃安装数量 **500+**
 *  WordPress 版本 ** 5.4 或更高版本 **
 *  已测试的最高版本为 **6.9.4**
 *  PHP 版本 ** 5.6 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/contextual-adminbar-color/) 、 [French (France)](https://fr.wordpress.org/plugins/contextual-adminbar-color/)
   和 [Portuguese (Portugal)](https://pt.wordpress.org/plugins/contextual-adminbar-color/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/contextual-adminbar-color)
 * 标签
 * [adminbar](https://cn.wordpress.org/plugins/tags/adminbar/)[color](https://cn.wordpress.org/plugins/tags/color/)
   [environment](https://cn.wordpress.org/plugins/tags/environment/)[scheme](https://cn.wordpress.org/plugins/tags/scheme/)
 *  [高级视图](https://cn.wordpress.org/plugins/contextual-adminbar-color/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  8 条 5 星评价     ](https://wordpress.org/support/plugin/contextual-adminbar-color/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/contextual-adminbar-color/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/contextual-adminbar-color/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/contextual-adminbar-color/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/contextual-adminbar-color/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/contextual-adminbar-color/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/contextual-adminbar-color/reviews/)

## 贡献者

 *   [ Jb Audras ](https://profiles.wordpress.org/audrasjb/)
 *   [ Whodunit ](https://profiles.wordpress.org/whodunitagency/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/contextual-adminbar-color/)