Checkbox field
bainternet edited this page Jan 17, 2012
·
1 revision
#Checkbox Field
To add a checkbox field to your metabox simply use the Checkbox
method of the metabox object:
$my_meta = new AT_Meta_Box($config);
$my_meta->addCheckbox('checkbox_field_id',array('name'=> 'My Checkbox '));
- ID : field id (string)
- args: (mixed|array)
-
'name' => field name/label, (string) optional
-
'desc' => field description, (string) optional
-
'std' => default value, (string) optional
-
'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,'checkbox_field_id',true);
if (!empty($saved_data)){
//field is check
}else{
//false
}