[wordpress插件] CMB Field Type: SorterCMB字段类型:排序器

wordpress 插件 文章 2020-03-26 05:00 0 30 全屏看文
评分
100
描述

This plugin gives you two CMB field types based on the Sorter script:

此插件基于Sorter脚本为您提供了两种CMB字段类型:

Usage

用法

`tb_sorter` – Select box with with typeahead-style search.

`tb_sorter` –选择带有预输入样式搜索的框。

Example:

示例:

    

    

$cmb->add_field(array(        

$ cmb-> add_field(array(        

'name' => 'Page Layout',        

'名称'=>'页面布局',        

'id' => $prefix .

'id'=> $ prefix。

'ingredients',        

'配料',        

'desc' => 'Select Page Layout',        

'desc'=>'选择页面布局',        

'type' => 'tb_sorter',        

'类型'=>'tb_sorter',        

'options' => array(            

'选项'=>数组(            

'enabled' => array(                

'启用'=>数组(                

'highlights' => 'Highlights',                

'highlights'=>'Highlights',                

'slider' => 'Slider',                

'slider'=>'Slider',                

'staticpage' => 'Static Page',            

'staticpage'=>'静态页面',            

),            

),            

'disabled' => array(                

'disabled'=>数组(                

'services' => 'Services'            

'服务'=>'服务'            

)        

)        

),    

),    

));

));

Out put

输出

    

    

get_post_meta(get_the_ID(), '_yourprefix_about_ingredients', true);

get_post_meta(get_the_ID(),'_yourprefix_about_ingredients',true);

IMPORTANT: The key pair of ‘placebo’ => ‘placebo’ IS NO LONGER REQUIRED.

重要提示:不再需要使用“安慰剂” =>“安慰剂”这对密钥。

安装步骤

You can install this field type as you would a WordPress plugin:

您可以像安装WordPress插件一样安装此字段类型:

    1. Download the plugin
    2. 下载插件

    3. Place the plugin folder in your /wp-content/plugins/ directory
    4. 将插件文件夹放置在/ wp-content / plugins /目录中

    5. Activate the plugin in the Plugin dashboard
    6. 在“插件”信息中心中激活插件

    7. Alternatively, you can place the plugin folder in with your theme/plugin.

    8. 或者,您可以将plugin文件夹与主题/插件一起放入。

      After you call CMB:

    9. 致电CMB后:

    Add another line to include the cmb-field-sorter.php file.

    添加另一行以包含cmb-field-sorter.php文件。

    Something like:

    像这样的东西:

    require_once ‘cmb-field-type-sorter/cmb-field-sorter.php’;

    require_once‘cmb-field-type-sorter / cmb-field-sorter.php';

下载地址
https://downloads.wordpress.org/plugin/cmb-field-type-sorter.zip
-EOF-