內容簡介
Flow Fields 是一個 WordPress 外掛,讓您輕鬆地為文章、頁面和其他自訂文章類型添加自訂欄位。它設計為輕量級和直觀,同時提供豐富的功能,管理自訂欄位。您可以創建自訂元框,其中包括文本、數字、日期、文件、圖像、文本區、重複器等欄位。您還可以設置默認值、指定必填欄位並為每個欄位添加說明。未來,我們計劃加入自訂文章類型管理、分類法和簡碼的支持。
使用方式:
1. 前往 WordPress 儀表板中的「Flow Boxes」選單,點擊「Add New Box」
2. 給您的元框命名並選擇應用的文章類型
3. 提交元框,然後點擊「Fields & Options」,再點擊「Add Field」來添加欄位到您的元框
4. 您可以選擇多種不同的欄位類型
5. 添加完所有欄位後,點擊「Save Meta Box」保存更改。
6. 您的自訂元框現在將顯示在所選文章類型的編輯屏幕上
7. 您可以使用 get_field() 函數來獲取代碼中的自訂欄位的值。此功能需提供欄位鍵、文章ID 和格式參數(可通過 true/false 進行數據清理),它將返回給定文章的欄位值。
問題與答案:
1. Flow Fields 是什麼?
- Flow Fields 是一個 WordPress 插件,專為管理自訂欄位而設計。
2. Flow Fields 可以為哪些內容添加自訂欄位?
- 它可以為文章、頁面和其他自訂文章類型添加自訂欄位。
3. 除了文本和數字,Flow Fields 還支持哪些欄位類型?
- Flow Fields 還支持日期、文件、圖像、文本區、重複器等欄位類型。
4. 怎麼創建自訂元框?
- 前往 WordPress 儀表板中的「Flow Boxes」選單,點擊「Add New Box」,命名元框並選擇應用的文章類型,點擊「Fields & Options」,再點擊「Add Field」添加欄位。
5. 如何取得自訂欄位的值?
- 您可以使用 get_field() 函數來獲取代碼中自訂欄位的值。需提供欄位鍵、文章 ID 和格式參數,它將返回給定文章的欄位值。
外掛標籤
開發者團隊
原文外掛簡介
Flow Fields is a WordPress plugin that allows you to easily add custom fields to your posts, pages, and other custom post types. It is designed to be lightweight and intuitive, while providing a robust set of features for managing custom fields.
With Flow Fields, you can create custom meta boxes with fields such as text, number, date, file, image, textarea, repeater, and more. You can also set default values, specify required fields, and add instructions for each field.
In the near future, we plan to add support for custom post type management, taxonomies, and shortcodes.
Usage
To create a custom meta box with fields, go to the “Flow Boxes” menu in the WordPress dashboard and click “Add New Box”. Give your meta box a title and select the post types that it should apply to. Submit the box, then click “Fields & Options” Then, click “Add Field” to add a field to your meta box.
There are many different field types to choose from, including text, number, date, file, image, textarea, repeater, and more.
Once you’ve added all of your fields, click “Save Meta Box” to save your changes. Your custom meta box will now be displayed on the edit screen for your selected post types.
To get the value of a custom field in your code, you can use the get_field() function. This function takes three parameters: the field’s key and the post ID and format (sanitizes data on true/false). It will return the value of the field for the given post.
