[WordPress] 外掛分享: Show Environment in Admin Bar

首頁外掛目錄 › Show Environment in Admin Bar
WordPress 外掛 Show Environment in Admin Bar 的封面圖片
200+
安裝啟用
★★★★★
5/5 分(3 則評價)
609 天前
最後更新
問題解決
WordPress 4.6+ v1.2.1 上架:2017-08-07

內容簡介

如果你跟我一樣,常常在不同的瀏覽器視窗中開啟同一個 WordPress 網站的不同版本,例如生產環境在一個視窗中,開發環境在另一個視窗中。

如果你也和我一樣,不知不覺在生產環境中編輯了內容,卻以為自己是在開發環境中進行編輯,或者反過來。

如果是這樣,那麼這個外掛就是為你而設的!

它會在管理工具列上加入當前環境的指示,比直接查看瀏覽器地址欄中的網址更容易識別。

預設行為

預設情況下,辨識兩種不同的環境:

生產

管理工具列上的節點有紅色背景(即,要小心你所進行的任何更改)。
如果未檢測到預備或開發或 QA 環境,則在管理工具列中顯示 Prod。

開發

管理工具列上的節點有綠色背景(即,進行更改是安全的)。
如果 WordPress 在 localhost 上運行(包括回送 IP 地址或 LAN IP 地址),則在管理工具列中顯示 Local。
如果 WP_DEBUG 定義為 true,則在管理工具列中顯示 Dev。

自訂預設行為

支援兩個額外的環境,但無法自動偵測:

預備

管理工具列上的節點有黃色背景(即,減慢速度,因為變更可能會進入生產網站中)。
有關如何啟用此環境的信息,請參閱文檔。

QA

管理工具列上的節點有藍色背景(即,“很酷”,你所做的更改不會影響生產網站)。
有關如何啟用此環境的信息,請參閱文檔。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.2.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Show Environment in Admin Bar」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

If you’re like me, you often have multiple versions of the same WordPress site open in different browser windows, e.g., production in one window and development in another window.
And if you’re like me, you have also unwittingly edited content in the production environment thinking you were doing so in the development environment or vice versa.
If so, then this plugin is for you!
It adds an indication of the current environment to the Admin Bar that is easier to see than examining the URL in your browser’s address bar.
Out-of-the-box behavior
Out-of-the-box, 2 different environments are recognized:

Production

The node added to the Admin Bar has a red background (i.e., Stop/be careful with any changes you make).
If neither a staging, QA, nor development environment is detected, then Prod is displayed in the Admin Bar.

Development

The node added to the Admin Bar has a green background (i.e., Go ahead, it is safe to make changes).
If WP is running on localhost (either a loopback IP address or LAN IP address), then Local displays in the Admin Bar.
If WP_DEBUG is defined & true, then Dev displays in the Admin Bar.

Customizing the out-of-the-box behavior
Two additional environments are supported, but cannot be automatically detected:

Staging

The node added to the Admin Bar has a yellow-ish background (i.e., Slow down, changes might make it into the production site).
For information on how to enable this environment, see the documentation.

QA

The node added to the Admin Bar has a blue background (i.e., “It’s cool”, changes you make won’t affect the production site).
For information on how to enable this environment, see the documentation.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon