单选框 radio

单选框radio即<input type="radio">标签。

范例:

  1. $ashu_meta[] = array(
  2.   'name'    => 'Radio Example',
  3.   'id'      => 'radio_example',
  4.   'desc'    => 'Please select your gender.',
  5.   'std'     => 'thirdness',
  6.   'subtype' => array(
  7.     'male'      => 'Male',
  8.     'female'    => 'Female',
  9.     'thirdness' => 'Third gender'
  10.   ),
  11.   'type'    => 'radio',
  12.   'multiple'    => false
  13. );

范例2:

  1. $ashu_meta[] = array(
  2.   'name'    => 'Radio Example2',
  3.   'id'      => 'radio_example2',
  4.   'desc'    => 'Please select a category',
  5.   'std'     => 'thirdness',
  6.   'subtype' => 'category',
  7.   'type'    => 'radio',
  8.   'multiple'    => false
  9. );

详解:

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。