[WordPress] 外掛分享: Features

首頁外掛目錄 › Features
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
50+
安裝啟用
★★★★★
5/5 分(1 則評價)
4362 天前
最後更新
問題解決
WordPress 3.3+ v0.0.2 上架:2013-06-26

內容簡介

一個受 Drupal 模組(Features 和 Strongarm)啟發的外掛,使 WordPress 中的選項版本控制成為可能。

一般的概念是將資料庫的大部分設置和結構內容匯出成檔案,以便通過 VCS(像 SVN、GIT、Mercurial)部署它們。

目前,唯一可匯出的設置是「wp-options」表的條目。

你需要這個外掛嗎?

如果你是唯一在進行網站開發的開發人員,只有一個開發環境 (產品伺服器)且不使用 VCS: 不需要,你只需要閉上眼睛,交叉雙手希望一切順利即可。

如何使用?

在管理員頁面中,在「工具」功能表下會有一個名為「Features」的新頁面。此頁面列出了 features_options_data.php 檔案中包含的所有設置。如果資料庫中的某個設置與檔案中的設置值不同,「還原」按鈕將可點擊,並且一個文本框會顯示來自資料庫的值。

如果您要用檔案中的值替換資料庫中的設置,請點擊「還原」按鈕。
如果要將檔案中的值替換成來自資料庫的值 (用於版本控制),請將文本框的內容複製到檔案中。

添加新的篩選選項

要從 wp_options 表添加新的選項,請使用 features_options 篩選器更改選項陣列:以列值作為鍵,以 option_value 列值作為值。

下一步是什麼?

這個外掛正在開發中。如果您知道自己在做什麼,可以使用它,而且至少會有升級路徑或手冊。

與 Features 一樣,目標是創建功能的外掛而不是手動編輯 plugin 中 features_options_data.php 檔案。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.0.2) 或搜尋安裝

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

原文外掛簡介

A plugin inspired by Drupal’s modules (Features and Strongarm) that enable the versioning of options in WordPress.
The general idea is to export a maximum amount of settings and structural content of the database to files to be able to deploy them through VCS (like SVN, GIT, Mercurial).
For now, the only exportable settings are the entries of the “wp-options” table.
Do you need this?
If you’re the only developer working on you’re website, you’re having only one development environment (production server) and you do not use VCS: no, the only things you need is to close your eyes, cross your fingers and hope that everything go fine.
How to use it?
In the admin, a new page called Features is accessible under the Tools menu. This page list all the settings contain in your features_options_data.php file. If one of the setting in your database has not the same value of the one in the file, the Revert button will be accessible to click and a text field will show you the value from the database.

If you want to replace what is in the database with the value from the file, click the Revert button.
If you want to replace what is in the file with the value from the database (for versioning), copy the content of the text field to the file.

Add a new option to the filter
To add a new option from the wp_options table, use the features_options filter to alter the options array: column value as the key and the option_value column value as the value.
What’s next?
This plugin is under development. If you know what your doing, you can use it and there will be an upgrade path, at least, a manuel one.
Like Features, the goal would be to have plugins generation for features instead of manually edit the features_options_data.php file of the plugin.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon