-
Notifications
You must be signed in to change notification settings - Fork 88
Select field
bainternet edited this page Jan 17, 2012
·
1 revision
#Select field
To add a Select field to your metabox simply use the addSelect
method of the metabox object:
$my_meta = new AT_Meta_Box($config);
$my_meta->addSelect('select_field_id',array('selectkey1'=>'Select Value1','selectkey2'=>'Select Value2'),array('name'=> 'My select ', 'std'=> array('selectkey2')));
- ID : field id (string)
- options: array of key => value pairs for select options (array)
- args: (mixed|array)
-
'name' => field name/label, (string) optional
-
'desc' => field description, (string) optional
-
'std' => default value, (string) optional
-
'multiple' => select multiple values, optional. Default is false.
-
'validate_func' => validate function name, (string) optional
-
- reapeater: When adding this field to a repeater block set to true (default false)
$saved_data = get_post_meta($post->ID,'select_field_id',true);
echo $saved_data;