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.
  • Use favicons to differentiate your browser tabs.
  • 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 )

使用者評論

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!
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!
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...
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!
2019 年 12 月 13 日
Perfect plugin that allows me to easily differentiate my various environments. THX !
閱讀全部 7 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Contextual Adminbar Color〉的開發相關工作。

參與者

〈Contextual Adminbar Color〉外掛目前已有 2 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Contextual Adminbar Color〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

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.