复选框checkbox
复选框checkbox即<input type="checkbox">标签。
范例:
- $ashu_meta[] = array(
- 'name' => 'Checkbox Example',
- 'id' => 'checkbox_example',
- 'desc' => 'Which fruits do you like?,Default are apple and orange.',
- 'std' => array('apple','orange'),
- 'subtype' => array(
- 'apple' => 'Apple',
- 'orange' => 'Orange',
- 'banana' => 'Banana',
- 'lemon' => 'Lemon'
- ),
- 'type' => 'checkbox',
- 'multiple' => false
- );
范例2:
- $ashu_meta[] = array(
- 'name' => 'Checkbox Example2',
- 'id' => 'checkbox_example2',
- 'desc' => 'Please select some tags',
- 'std' => '' ,
- 'subtype' => 'post_tag',
- 'type' => 'checkbox',
- 'multiple' => false
- );
详解:
name - 自定义字段标题
id - 自定义字段名称,获取数据时用。敬告:请确配置文件中所有id都不相同,同时避免post\page\title等词。
desc - 自定义字段描述信息
std - 数组,默认选中,由于复选框可以选择多个,所以该参数使用数组(数组中的值请设置为buttons中存在的)
subtype - 数组或字符串,即选项。注意真正保存的数据为数组的键名,即范例中的英文male\female,键名请避免中文,该参数设置为page、category(或自定义分类法名称)、nav_menu、sidebar时会自动调用相关内容。
type - 值为checkbox时,本条字段类型为复选框
multiple - 输入框自增,若值为true,则文件上传输入框的个数可点击增加。
其它:
subtype可以是自己定义的数组,也可以是page、category(或自定义分类法名称)、nav_menu、sidebar。