Display Environment Type


WordPress 5.5 導入了區分開發、測試、正式環境類型的方式,這個外掛能在工具列上顯示網站的環境類型。



  • 工具列顯示 [正式環境]
  • 工具列顯示 [測試環境]
  • 工具列顯示 [開發環境]
  • 工具列顯示 [自訂環境]
  • [網站概況] 小工具的網站環境類型資訊


  1. 透過 WordPress 管理後台的 [外掛] 選單安裝並啟用外掛。





自訂環境類型是 WordPress 5.5 加入的原生功能,但已於 5.5.1 移除。這個外掛不再支援這項功能。



如需進一步控制,請使用 det_display_environment_type 篩選器勾點:

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' );


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.
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.
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.
閱讀全部 2 則使用者評論


以下人員參與了開源軟體〈Display Environment Type〉的開發相關工作。


〈Display Environment Type〉外掛目前已有 14 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Display Environment Type〉外掛本地化為台灣繁體中文版


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


1.3.2 (2023-11-10)

  • Assessibility improvements by @mrwweb.

1.3.1 (2022-03-30)

  • Skip loading of the CSS file on the front end if 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)

  • Removes 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 environmment 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.