[WordPress] 外掛分享: ACF: Fields in Custom Table

WordPress 外掛 ACF: Fields in Custom Table 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「ACF: Fields in Custom Table」是 2020-11-25 上架。
  • 目前有 100 個安裝啟用數。
  • 上一次更新是 2021-05-26,距離現在已有 1440 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.9.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.0 以上。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

eduardomarcolino |

外掛標籤

acf | meta | fields | custom fields | advanced custom fields |

內容簡介

這款 ACF 外掛可以讓你將 ACF 數據存儲在結構化數據庫表中,而不是 WordPress 核心 meta 表中。

它使用 ACF 的 acf/update_field_group 鉤子來創建/更新數據庫,然後使用 acf/save_post 鉤子來存儲數據。

它深受 Austin Ginder 的文章「https://anchor.host/acf-custom-fields-stored-in-custom-table/」的啟發。

你可以通過在 https://github.com/eduardo-marcolino/acf-fields-in-custom-table 上提交 PR/Issue 來貢獻這款外掛。

支持的字段

文本
文本區域
數字
範圍
電子郵件
網址
密碼
圖片
文件
所見即所得編輯器
oEmbed
下拉框
勾選框
單選按鈕
按鈕組
真假值
日期選擇器
日期時間選擇器
時間選擇器
顏色選擇器
鏈接
文章對象
頁面鏈接
關聯
分類法
用戶

關聯字段

此外掛支持以下關聯字段類型:文章對象、頁面鏈接、關聯、分類法和用戶。

它可以根據 multiple 選項存儲單個和多個值。

如果它是單個值字段,則列類型為 bigint(20) unsigned
如果它是多個值字段,則列類型為 longtext,並使用 json 格式存儲日期。

你可以使用 MySQL 的函數 JSON_CONTAINS 查詢具有多個值的關聯字段。
以下是一個示例:

數據表:

+---------+-------------------+--------+
| post_id | title | stores |
+---------+-------------------+--------+
| 1 | 蒼蠅王 | [1,2] |
| 2 | 孤島驚魂 | [2] |
| 3 | 1984 | [3] |
+---------+-------------------+--------+

查詢:

SELECT * FROM wp_acf_books WHERE JSON_CONTAINS(stores, 2, '$')

上述查詢將返回「蒼蠅王」和「孤島驚魂」。

ACF 兼容性

此外掛已在 ACF 5 免費版本上進行了測試。

原文外掛簡介

This ACF plugin makes it possible to store ACF data in structured database tables instead of WordPress core meta tables.
It uses ACF’s acf/update_field_group hook to create/update the database and then uses acf/save_post hook to store the data.
It was heavily inspired by Austin Ginder’s post https://anchor.host/acf-custom-fields-stored-in-custom-table/.
You can contribute to this plugin by submit PR/Issue in https://github.com/eduardo-marcolino/acf-fields-in-custom-table.
Supported Fields

Text
Text Area
Number
Range
Email
URL
Password
Image
File
Wysiwyg Editor
oEmbed
Select
Checkbox
Radio Button
Button Group
True / False
Date Picker
Date Time Picker
Time Picker
Color Picker
Link
Post Object
Page Link
Relationship
Taxonomy
User

Relational Fields
This plugin supports the following relational field types: Post Object, Page Link, Relationship, Taxonomy and User.
It can store both single and multiple values based on the multiple option.

If it’s a single value field, then the column type will be bigint(20) unsigned
If it’s a multiple value field, then the column type will be longtext and the date will be stored in json format.

You can query relational fields with multiple values using using MySQL’s function JSON_CONTAINS.
Here is an example:
Table:
+---------+-------------------+--------+
| post_id | title | stores |
+---------+-------------------+--------+
| 1 | Lord of the Flies | [1,2] |
| 2 | The Island | [2] |
| 3 | 1984 | [3] |
+---------+-------------------+--------+

Query:
SELECT * FROM wp_acf_books WHERE JSON_CONTAINS(stores, 2, '$')

The query above will return “Lord of the Flies” and “The Island”.
ACF Compatibility
This plugin was tested with ACF 5 FREE Version .

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「ACF: Fields in Custom Table」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1 | 0.2 | 0.3 | 0.4 | 0.5 | trunk |

延伸相關外掛(你可能也想知道)

  • Advanced Custom Fields (ACF®) 》Advanced Custom Fields 可以讓 WordPress 網站成為一個完整的內容管理系統,提供您所有工具以更好管理您的數據。, 使用 Advanced Custom Fields 外掛,完全...。
  • CMB2 》CMB2 是一個開發人員的工具包,用於在 WordPress 上構建 metabox,自定義字段和表單,可以讓您震撼。輕鬆管理帖子、條款、用戶、評論的元數據,或創建自定義...。
  • Advanced Custom Fields: Extended 》🚀 全方位增強套件,可改進WordPress和Advanced Custom Fields。此外掛旨在提供一個強大的管理框架,涵蓋了眾多改進和優化。, 此外掛需要至少 ACF Pro 5.8。,...。
  • Dynamic Conditions 》Dynamic Conditions 是一個 Elementor 外掛,加入了條件邏輯來顯示或隱藏不同元素。該外掛將條件添加到動態標籤中,以顯示/隱藏小工具或區塊。, 此外掛需要 E...。
  • ACF Photo Gallery Field 》t; 'Status', , 'name' => 'status', , 'choices' => array(, 'public' => 'Public', , 'private' => ...。
  • Custom Field Suite 》Custom Field Suite (CFS) 讓您為文章添加自定義欄位。它輕量級且經過過往使用者的測試(很難出現錯誤)。, 需要了解的事項, , 我們不提供支援。, 這是一個免...。
  • Custom Field Template 》「Custom Field Template 外掛」在「編寫文章/頁面」時,新增自訂欄位的預設設定。這個模板格式基本上跟「rc:custom_field_gui 外掛」差不多,不同處在於:, ...。
  • Custom Block Builder – Lazy Blocks 》WordPress 自訂區塊外掛程式, ★★★★★, 開發商使用於 WordPress 自訂區塊的魔法棒。我們創建了 Lazy Blocks WordPress 外掛程式,協助每位開發商取得他們需要的...。
  • Secure Custom Fields 》總結:SCF 是一款能夠擴展 WordPress 功能的外掛,使其成為一個靈活的內容管理工具。透過 SCF,管理自定義數據變得簡單高效。, , 1. 為什麼 SCF 是一個靈活的...。
  • Genesis Custom Blocks 》Genesis Custom Blocks 為 WordPress 開發人員提供了必要的工具,以應對現代 WordPress 「區塊先行」的實境。, WordPress 區塊編輯器(又稱 Gutenberg)為我...。
  • Product Input Fields for WooCommerce 》Product Input Fields for WooCommerce 插件可讓您在 WooCommerce 產品的前端添加自定義輸入字段,以供顧客在添加產品到購物車之前填寫。, 可以全域性地(即...。
  • BuddyPress Xprofile Custom Field Types 》BuddyPress Xprofile Custom Field Types 插件為 BuddyPress 資料檔案新增了一些必要的欄位類型。, BuddyPress Xprofile Custom Field Types 與 BP Profile S...。
  • PixFields 》使用 PixFields,您可以擁有自訂欄位的視覺化管理工具。, 注意:此外掛不會新增任何樣式至自訂欄位的輸出結果,它僅僅新增了元數據(metadata)並提供了一種覆...。
  • NextGEN Custom Fields 》這款外掛是為了將自訂欄位加到卓越且受歡迎的 NextGEN Gallery 外掛而開發。只需輸入新欄位的名稱,從「輸入」、「文字區域」或「下拉式選單」中選擇,就會自...。
  • Just Custom Fields 》Just Custom Fields(即自定義欄位)增加了在文章、頁面(與其他自定義文章類型)和分類中添加附加欄位的功能。安裝後,您將看到一個簡單的設置頁面,易於使...。

文章
Filter
Apply Filters
Mastodon