单选框 radio
单选框radio即<input type="radio">标签。
范例:
- $ashu_meta[] = array(
- 'name' => 'Radio Example',
- 'id' => 'radio_example',
- 'desc' => 'Please select your gender.',
- 'std' => 'thirdness',
- 'subtype' => array(
- 'male' => 'Male',
- 'female' => 'Female',
- 'thirdness' => 'Third gender'
- ),
- 'type' => 'radio',
- 'multiple' => false
- );
范例2:
- $ashu_meta[] = array(
- 'name' => 'Radio Example2',
- 'id' => 'radio_example2',
- 'desc' => 'Please select a category',
- 'std' => 'thirdness',
- 'subtype' => 'category',
- 'type' => 'radio',
- 'multiple' => false
- );
详解:
name - 自定义字段标题
id - 自定义字段名称,获取数据时用。敬告:请确配置文件中所有id都不相同,同时避免post\page\title等词。
desc - 自定义字段描述信息
std - 默认选中(请设置为buttons中的一个)
subtype - 数组或字符串,即选项。注意真正保存的数据为数组的键名,即范例中的英文male\female,键名请避免中文,该参数设置为page、category(或自定义分类法名称)、nav_menu、sidebar时会自动调用相关内容。
type - 值为radio时,本条字段类型为单选框
multiple - 输入框自增,若值为true,则文件上传输入框的个数可点击增加。
其它:
subtype可以是自己定义的数组,也可以是page、category(或自定义分类法名称)、nav_menu、sidebar。