[WordPress] 外掛分享: Custom Field Builder – WordPress custom fields plugin

首頁外掛目錄 › Custom Field Builder – WordPress custom fields plugin
10+
安裝啟用
★★★★★
5/5 分(1 則評價)
2595 天前
最後更新
問題解決
WordPress 4.6+ PHP 5.4+ v1.2.4 上架:2018-11-16

內容簡介

Custom Field Builder 是一個功能強大且輕量的開發者外掛程式,可為 WordPress 建立自訂的 meta box 和自訂欄位。

功能

• 許多免費的自訂欄位(定期更新和增加新欄位)。
• 安裝容易且使用非常簡單。
• 淨淨的程式碼(提高您的管理效能)。

連結

• 文件

可用欄位

• 文字方塊
• 文字區域
• 選擇框
• 媒體(圖片、附件)
• 邏輯(勾選框僅能為 “true” 或 “false”)
• 顏色選擇器
• 重複
• 勾選框群組
• 日期選擇器
• 文章關聯

使用方法

觀看這個短視頻教學

將以下程式碼新增至您的 functions.php(或任何方便的檔案)中。

<?php
    add_action('cf_builder_init', function ($cfBuilder) {
        $cfBuilder->registerTemplate([
            'id'          => 'custom_fields',
            'title'       => 'Custom Field Builder example',
            'post_type'   => 'post',
            'position'    => 'normal',
            'priority'    => 'high',
            'fields'      => [

                'author_name' => [
                    'type'    => 'textbox',
                    'title'   => 'Author name'
                ],

                'author_bio' => [
                    'type'    => 'textarea',
                    'title'   => 'Author bio'
                ]

            ]
        ]);
    });
?>

您也可以將自訂的樣板包含在 php 檔案中。例如:

<?php
    add_action('cf_builder_init', function ($cfBuilder) {
        $cfBuilder->registerTemplate('path_to_your_template_file.php');
    });
?>

** 在外掛程式目錄的 examples/base-fields-template.php 中查看所有欄位範例! **

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Custom Field Builder – WordPress custom fields plugin」→ 直接安裝(推薦)

原文外掛簡介

Custom Field Builder is a powerful and lightweight developer plugin to create custom meta boxes and custom fields for WordPress.
Features
• Many free custom fields (regular updating and adding new fields).
• Easy to install and very easy to use.
• Pure and clean code (increase your admin performance).
Links
• Documentation
Available fields
• Textbox
• Textarea
• Select
• Media (image, attachments)
• Logic (checkbox may only “true” or “false”)
• Color picker
• Repeater
• Checkbox group
• Date picker
• Post relationship
Usage
Watch this short video tutorial

Add the following code to your functions.php (or in any convenient file).
registerTemplate([
'id' => 'custom_fields',
'title' => 'Custom Field Builder example',
'post_type' => 'post',
'position' => 'normal',
'priority' => 'high',
'fields' => [

'author_name' => [
'type' => 'textbox',
'title' => 'Author name'
],

'author_bio' => [
'type' => 'textarea',
'title' => 'Author bio'
]

]
]);
});
?>

You also can include your custom template in php file. For example:
registerTemplate('path_to_your_template_file.php');
});
?>

** See all fields example in examples/base-fields-template.php in plugin directory! **

延伸相關外掛

文章
Filter
Apply Filters
Mastodon