Title: Display Environment Type
Author: Stoil Dobreff
Published: <strong>2020 年 8 月 21 日</strong>
Last modified: 2025 年 12 月 19 日

---

搜索插件

![](https://ps.w.org/display-environment-type/assets/icon-256x256.png?rev=2366333)

# Display Environment Type

 作者：[Stoil Dobreff](https://profiles.wordpress.org/sdobreff/)

[下载](https://downloads.wordpress.org/plugin/display-environment-type.1.6.0.zip)

[实时预览](https://cn.wordpress.org/plugins/display-environment-type/?preview=1)

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

 [支持](https://wordpress.org/support/plugin/display-environment-type/)

## 描述

WordPress 5.5 introduced a way to differentiate between environment types (development,
staging, production). This plugin shows your site’s environment type in the admin
bar and the dashboard “At a Glance” widget.

[More info about the feature](https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/)

To gain additional control — for example, setting the environment or other values
from the WP admin (when `wp-config.php` is writable) — consider installing our other
plugin **[0 Day Analytics](https://wordpress.org/plugins/0-day-analytics/)**.

### Recommended Plugins

 * [0 Day Analytics](https://wordpress.org/plugins/0-day-analytics/) — a powerful
   plugin for sites that need more insight into errors and runtime behavior. It 
   includes a Cron manager, a Transient manager (database-backed), DB manager, Snippet
   manager, Mail manager, Plugin Version Switcher available from the Plugins page
   and many more.

## 屏幕截图

[⌊Admin bar display (production).⌉⌊Admin bar display (production).⌉[

Admin bar display (production).

[⌊Admin bar display (staging).⌉⌊Admin bar display (staging).⌉[

Admin bar display (staging).

[⌊Admin bar display (development).⌉⌊Admin bar display (development).⌉[

Admin bar display (development).

[⌊Admin bar display (custom).⌉⌊Admin bar display (custom).⌉[

Admin bar display (custom).

[⌊The "At a Glance" widget.⌉⌊The "At a Glance" widget.⌉[

The “At a Glance” widget.

## 安装

 1. Install and activate the plugin from the ‘Plugins’ menu in WordPress.

## 常见问题

### Can I set a custom color for my environment types?

Colors are intentionally fixed to avoid confusion. If colors were configurable, 
they’d need to be identical across all related servers to remain consistent.

### What happens if I define custom environment types?

Custom environment types were briefly supported in WordPress 5.5 but were removed
in 5.5.1. This plugin does not support custom types.

### Why don’t non-administrators see the environment type on the front end?

By default, the environment type is shown only to users with administrative capabilities.
This avoids exposing a prominent colored indicator to regular subscribers and other
non-admin users.

For additional control, use the `det_display_environment_type` filter hook. Example:

    ```
    function rt_det_display_filter( $display ) {
        // Disable the environment type display for user ID 2.
        return ( get_current_user_id() !== 2 );
    }
    add_filter( 'det_display_environment_type', 'rt_det_display_filter' );
    ```

## 评价

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

### 󠀁[Helpful Reminder](https://wordpress.org/support/topic/helpful-reminder/)󠁿

 [ericsackett](https://profiles.wordpress.org/ericsackett/) 2025 年 4 月 9 日

Easy to see reminder of which version of the site I’m on.

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

### 󠀁[This is what a developer needs](https://wordpress.org/support/topic/this-is-what-a-developer-needs/)󠁿

 [drinkmaker](https://profiles.wordpress.org/drinkmaker/) 2024 年 1 月 24 日

Five stars for Display Environment Type! Huge thanks to the author for creating 
this gem. The plugin might be small, but it’s incredibly useful, doing exactly what
you’d expect without any unnecessary clutter. No settings hassle – just install 
and get to work seamlessly.

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

### 󠀁[Yes, you are working on the live site – PAY ATTENTION!](https://wordpress.org/support/topic/yes-you-are-working-on-the-live-site-pay-attention/)󠁿

 [Bjarne Oldrup](https://profiles.wordpress.org/oldrup/) 2022 年 4 月 26 日

I switch a LOT between production sites and a clone made for testing, when creating
a real staging environment is not possible. More than once, I have unintentionally
made changes to the wrong instance of the site. That’s no fun. Display Environment
Type makes it very clear what I’m working on, when I should pay extra attention.
Recommended.

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

### 󠀁[Nice little helper](https://wordpress.org/support/topic/nice-little-helper-4/)󠁿

 [Bego Mario Garde](https://profiles.wordpress.org/pixolin/) 2020 年 8 月 21 日

Have you ever accidentally added test content to a productive website? You can now
define a constant in your wp-config.php to distinguish between development, staging
and productuion sites. To make this visible, this lean but helpful plugin adds an
indicator to the admin bar and dashboard widget which helps to avoid mistakes as
adding “Lorem ipsum” to your productive site. 🙂 Plugin works like a charm. No settings
needed. Install, activate and feel happy.

 [ 阅读所有4条评价 ](https://wordpress.org/support/plugin/display-environment-type/reviews/)

## 贡献者及开发者

「Display Environment Type」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Stoil Dobreff ](https://profiles.wordpress.org/sdobreff/)
 *   [ Roy Tanck ](https://profiles.wordpress.org/roytanck/)
 *   [ Mark Jaquith ](https://profiles.wordpress.org/markjaquith/)
 *   [ tflight ](https://profiles.wordpress.org/tflight/)
 *   [ mrwweb ](https://profiles.wordpress.org/mrwweb/)
 *   [ tekapo ](https://profiles.wordpress.org/tekapo/)

「Display Environment Type」插件已被翻译至 14 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/display-environment-type/contributors)
为本插件所做的贡献。

[帮助将「Display Environment Type」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/display-environment-type)

### 对开发感兴趣吗?

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

## 更新日志

#### 1.6.0 (2025-12-18)

 * Code improvements. Added the Gutenberg menu. 0 Day Analytics introduced.

#### 1.5.0 (2024-07-01)

 * Code improvements; shows the constants’ values regardless of the `WP_DEBUG` constant.
   WP Control plugin introduced.

#### 1.4.0 (2024-04-07)

 * Code improvements and UI fixes — show the icon on mobile and set colors in the“
   At a Glance” widget. Added WordPress version in the drop-down menu.

#### 1.3.5 (2025-04-04)

 * Added a drop-down submenu with WP constants and their values (enabled / disabled).

#### 1.3.4 (2024-12-20)

 * Added a filter hook to modify the environment’s display name (thanks @erniecom).

#### 1.3.3 (2024-07-05)

 * Internationalization improvements by @tekapo.

#### 1.3.2 (2023-11-10)

 * Accessibility improvements by @mrwweb.

#### 1.3.1 (2022-03-30)

 * Skip loading the CSS file on the front end if the toolbar is hidden (thanks @tflight).

#### 1.3 (2020-08-25)

 * Code refactor (thank you, @markjaquith).
 * Environment type now hidden by default for subscribers.

#### 1.2.1 (2020-08-23)

 * Removed the distracting hover effect (thank you, @markjaquith).
 * Hardening against XSS (props @markjaquith).

#### 1.2 (2020-08-21)

 * Adds a filter hook to allow you to determine whether the environment is displayed.

#### 1.1 (2020-08-21)

 * Added a conditional front-end display (admins only).
 * Improved plugin initialization.

#### 1.0.2 (2020-08-21)

 * Removed the (unstyled) display on the front-end admin bar.
 * Added a FAQ section to the readme file.

#### 1.0.1 (2020-08-21)

 * Fixed the plugin description and plugin URI.

#### 1.0 (2020-08-20)

 * Initial release.

## 额外信息

 *  版本 **1.6.0**
 *  最后更新：**6 月前**
 *  活跃安装数量 **1,000+**
 *  WordPress 版本 ** 5.5 或更高版本 **
 *  已测试的最高版本为 **6.9.4**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [Chinese (Taiwan)](https://tw.wordpress.org/plugins/display-environment-type/)、
   [Dutch](https://nl.wordpress.org/plugins/display-environment-type/) 、 [Dutch (Belgium)](https://nl-be.wordpress.org/plugins/display-environment-type/)、
   [English (US)](https://wordpress.org/plugins/display-environment-type/) 、 [French (France)](https://fr.wordpress.org/plugins/display-environment-type/)、
   [German](https://de.wordpress.org/plugins/display-environment-type/) 、 [Japanese](https://ja.wordpress.org/plugins/display-environment-type/)、
   [Norwegian (Bokmål)](https://nb.wordpress.org/plugins/display-environment-type/)、
   [Portuguese (Portugal)](https://pt.wordpress.org/plugins/display-environment-type/)、
   [Romanian](https://ro.wordpress.org/plugins/display-environment-type/) 、 [Russian](https://ru.wordpress.org/plugins/display-environment-type/)、
   [Spanish (Mexico)](https://es-mx.wordpress.org/plugins/display-environment-type/)、
   [Spanish (Spain)](https://es.wordpress.org/plugins/display-environment-type/)、
   [Spanish (Venezuela)](https://ve.wordpress.org/plugins/display-environment-type/)
   和 [Swedish](https://sv.wordpress.org/plugins/display-environment-type/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/display-environment-type)
 * 标签
 * [development](https://cn.wordpress.org/plugins/tags/development/)[environment](https://cn.wordpress.org/plugins/tags/environment/)
   [production](https://cn.wordpress.org/plugins/tags/production/)[staging](https://cn.wordpress.org/plugins/tags/staging/)
 *  [高级视图](https://cn.wordpress.org/plugins/display-environment-type/advanced/)

## 评级

 5 星（最高 5 星）。

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

[Your review](https://wordpress.org/support/plugin/display-environment-type/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/display-environment-type/reviews/)

## 贡献者

 *   [ Stoil Dobreff ](https://profiles.wordpress.org/sdobreff/)
 *   [ Roy Tanck ](https://profiles.wordpress.org/roytanck/)
 *   [ Mark Jaquith ](https://profiles.wordpress.org/markjaquith/)
 *   [ tflight ](https://profiles.wordpress.org/tflight/)
 *   [ mrwweb ](https://profiles.wordpress.org/mrwweb/)
 *   [ tekapo ](https://profiles.wordpress.org/tekapo/)

## 支持

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

 [查看支持论坛](https://wordpress.org/support/plugin/display-environment-type/)