前言介紹
- 這款 WordPress 外掛「Set the Stage」是 2021-12-21 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2023-08-16,距離現在已有 627 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.7 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
- 有 1 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
menu | stage | switcher | environment |
內容簡介
這個外掛會在管理列新增一個選單,以快速辨識網站不同的環境(例如正式版和開發版),並能輕鬆地在其他環境切換到相同的網址。支援多站架設,包括子網域和子目錄架構。
設定
外掛有一個方便的設定頁面,但也可以透過篩選器鉤子在程式碼上進行設定。
透過WordPress管理介面設定環境
前往WordPress管理介面中的「設定>設定環境」,以檢視和編輯設定。
使用WordPress篩選器鉤子設定環境
鉤綁至drgnff_wp_stage_switcher__environments,並傳回具有環境的陣列。以下是篩選器函數的範例:
add_filter( 'drgnff_wp_stage_switcher__environments', function ($envs) {
return [
[
'url' => 'https://example.com', // 主頁 網址
'title' => '正式版', // 名稱
'color' => '#ffffff', // 十六進位顏色 (可選)
'background_color' => '#ff0000', // 十六進位背景色 (可選)
],
[
'url' => 'https://example.com',
'title' => '開發版',
'color' => '#ffffff',
'background_color' => '#228b22',
],
];
});
控制切換器的可見度
預設情況下,切換器選單會顯示給所有已登入的使用者。通過鉤綁至drgnff_wp_stage_switcher__should_display_switcher,並傳回布林值,您可以控制是否顯示切換器。
覆寫預設環境
如果目前的網站不在環境列表中,預設環境會用於當前網站。 通過鉤綁至drgnff_wp_stage_switcher__default_environment,您可以控制預設環境的標題和顏色。
設定備註
篩選器優先於在設定頁面上進行的手動設定。如果使用篩選器,則相關部分的設定頁面會呈現為唯讀模式。
對於多站安裝,請使用主站的網址。
本外掛邏輯的啟動,是在插件載入時的plugins_loaded鉤子以11的優先權進行。因此,影響外掛的鉤綁器必須在之前加入。
原文外掛簡介
Adds a menu to the admin bar to quickly identify different environments for a site (e.g. production and development) and easily switch to the same URL on other environments. Multi-site compatible for both sub-domain and sub-directory installations.
Configuration
The plugin has a convenient settings page but can also be configured programatically via a filter hook.
Setting environments via the WordPress admin interface
Navigate to “Settings > Set the Stage” in the WordPress admin to review and edit the configuration.
Setting environments via a WordPress filter hook
Hook to drgnff_wp_stage_switcher__environments and return an array with environments. Here’s an example filter function:
add_filter( 'drgnff_wp_stage_switcher__environments', function ($envs) {
return [
[
'url' => 'https://example.com', // home url
'title' => 'LIVE', // display name
'color' => '#ffffff', // hex color (optional)
'background_color' => '#ff0000', // hex color (optional)
],
[
'url' => 'https://example.com',
'title' => 'DEVELOPMENT',
'color' => '#ffffff',
'background_color' => '#228b22',
],
];
});
Controlling visibility of the switcher
By default the switcher menu is displayed to all logged in users. By hooking to drgnff_wp_stage_switcher__should_display_switcher and returning a boolean you can control whether the switcher should be displayed.
Overriding the default environment
The default environment is used for the current site if it’s not in the list of environments. By hooking to drgnff_wp_stage_switcher__default_environment you can control the title and colors for the default environment.
A few notes on configuration
Filters have a precedence over manual configuration made in the settings page. If filters are used then relevant sections on the settings page are rendered as read-only.
For multi-site installations use the URLs of the main site.
The plugin initiates its logic on the plugins_loaded hook with priority 11. Thus filter hooks that affect the plugin must be added before that.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Set the Stage」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Display Environment Type 》WordPress 5.5 引入了一種區分環境類型(開發、備試、正式)的方式。此外掛會在管理列顯示您網站的環境類型。, 更多有關此新功能的資訊。
Contextual Adminbar Color 》這個外掛提供了自訂管理列顏色的功能,以區分環境(測試、預產、正式)。使用起來非常容易且開發者友好。, 此外,該外掛提供了一個設定畫面,其中包含以下選...。
Dev Info Bar 》這是一個簡單的 WordPress 擴充功能,會顯示在管理列上,提供系統資訊,例如 PHP、MySQL 版本以及正在使用的 WordPress 詳細資訊。。
WP System 》輕鬆找出您的 WordPress 環境和伺服器設定問題。, 支援, WP System 支援 於官方 WordPress 儲存庫。, 使用方法:, , 前往 工具 -> WP System, , 卸載, 停...。
Environment & Debug Bar 》總結:WordPress 外掛可以在工具列上顯示環境和除錯信息,並在 GitHub 上接受貢獻。, , 問題與答案:, - 這個 WordPress 外掛可以做什麼?, - 在工具列上顯...。
PLX Multi-Environments 》PLX Multi-Environments 可直接從 WordPress 管理畫面中管理獨立的開發、測試和正式環境。, 安裝了分離的設定檔並備份現有的 wp-config.php 設定後,您可以自...。
WordPress Environment Indicator 》此外掛會在管理列上方顯示當前環境的指標,讓您輕鬆地判斷您正在哪一個環境下觀看。, 這僅會在 WordPress 的管理介面中顯示,並不會顯示在網站本身。。
Handprint 》什麼是Handprint外掛程式?, Handprint讓你可以透過你的電子商店每一次消費自動向非政府組織捐款。一旦設置完成,一個“小部件”會在你的購物車頁面顯示你的影...。
dotenv 》.env 檔案中任何以 WPENV_ 為前綴的變數都會被用於覆蓋 WordPress 選項。例如,如果您想要設定特定環境為 “阻止搜尋引擎索引這個網站”,您可以在...。
Online Leaf 》由於全球瀏覽網頁耗能大量能源,Online Leaf 開發方法來減少瀏覽互聯網所需的能源量,使網站變得更綠色。, 這個外掛, 這個外掛可讓您的博客在博客上安裝綠色...。
MÜLLweg! DE 》您可以使用短代码“[muellwegde]”在自己的主頁直接嵌入 MÜLLweg! DE。, MÜLLweg! DE 是一個專門在德國全境報告非法垃圾處置問題的缺陷報告工具。, MÜLLweg! DE...。
Enviromon 》這個外掛會在管理頁面加上一個簡單的下拉選單,讓開發者和客戶可以快速了解他們目前所在的環境。。
Env Bar 》Env Bar 是一個很好的方法來追蹤您的伺服器環境。您可以在 Env Bar 設定頁面中選擇開發、測試或正式環境,並輸出一個有色條在您的網站底部。, 製作者授權, 圖...。
eGreen Web Meter 》透過這個外掛程式將您的網站轉換為碳中和的空間。, 主要好處有哪些呢?, , 讓您的網站成為綠色空間,對環境友善。(不僅涵蓋您的網站主機,也包含網路及訪客...。
WP Environment Label 》WP 環境標籤會在前端和管理面板中顯示一個小標籤,位於屏幕右下角。您可以通過設定變量‘WP_ENVIRONMENT_LABEL’來定義名稱,也可以在設置部分進行...。