[wordpress插件] Custom Field Builder – WordPress custom fields plugin自定义字段生成器– WordPress自定义字段插件

wordpress 插件 文章 2020-04-08 02:30 477 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

Custom Field Builder is a powerful and lightweight developer plugin to create custom meta boxes and custom fields for WordPress.

自定义字段生成器是一个功能强大且轻巧的开发人员插件,可为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

•Textarea

• Select

•选择

• Media (image, attachments)

•媒体(图片,附件)

• Logic (checkbox may only “true” or “false”)

•逻辑(复选框只能为“ true”或“ 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).

将以下代码添加到您的functions.php(或任何方便的文件中)。

  <?php    

add_action('cf_builder_init', function ($cfBuilder) {        

add_action('cf_builder_init',函数($ cfBuilder){        

$cfBuilder->registerTemplate([            

$ cfBuilder-> registerTemplate([            

'id' => 'custom_fields',            

'id'=>'custom_fields',            

'title' => 'Custom Field Builder example',            

'title'=>'Custom Field Builder示例',            

'post_type' => 'post',            

'post_type'=>'post',            

'position' => 'normal',            

'位置'=>'正常',            

'priority' => 'high',            

'优先级'=>'高',            

'fields' => [                

'fields'=> [                

'author_name' => [                    

'author_name'=> [                    

'type' => 'textbox',                    

'类型'=>'文本框',                    

'title' => 'Author name'                

'标题'=>'作者姓名'                

],                

],                

'author_bio' => [                    

'author_bio'=> [                    

'type' => 'textarea',                    

'type'=>'textarea',                    

'title' => 'Author bio'                

'标题'=>'作者简介'                

]            

]            

]        

]        

]);    

]);    

});

});

?>

?>

You also can include your custom template in php file.

您还可以将自定义模板包含在php文件中。

For example:

例如:

  <?php    

add_action('cf_builder_init', function ($cfBuilder) {        

add_action('cf_builder_init',函数($ cfBuilder){        

$cfBuilder->registerTemplate('path_to_your_template_file.php');    

$ cfBuilder-> registerTemplate('path_to_your_template_file.php');    

});

});

?>

?>

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

**请参阅插件目录中examples / base-fields-template.php中的所有字段示例!

**

**

安装步骤

Via Composer.

通过作曲家

composer require kirillbdev/custom-field-builder:dev-master

  composer需要kirillbdev / custom-field-builder:dev-master

To do an automatic install of Custom Field Builder, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.

要自动安装Custom Field Builder,请登录WordPress仪表板,导航至“插件”菜单,然后单击“添加新项”。

In the search field type “cfb” or “Custom Field Builder” and click Search Plugins.

在搜索字段中输入“ cfb”或“自定义字段生成器”,然后单击“搜索插件”。

Once you have found it you can install it by simply clicking “Install Now”.

找到它后,只需单击“立即安装”即可安装它。

The WordPress codex contains instructions on how to install a WordPress plugin.

WordPress抄本包含有关如何安装WordPress插件的说明

下载地址
https://downloads.wordpress.org/plugin/custom-field-builder.zip
-EOF-

AI助手支持GPT4.0