Skip to content
bainternet edited this page Jun 15, 2012 · 1 revision

#Input Field

To add a Time Picker field to your metabox simply use the addTime method of the metabox object:

$my_meta =  new AT_Meta_Box($config);
$my_meta->addTime('time_field_id',array('name'=> 'My Time'));`

Method arguments:

  • ID : field id (string)
  • args: (mixed|array)
    •  'name' =>  field name/label, (string) optional
      
    •  'desc' =>  field description, (string) optional
      
    •  'std' =>   default value, (string) optional
      
    •  'style' => custom style for field, (string) optional
      
    •  'validate_func' => validate function name, (string) optional
      
      •  'format' => time format, default hh:mm. Optional. See more formats here: http://goo.gl/83woX
        
  • reapeater: When adding this field to a repeater block set to true (default false)

Get Field Data:

$saved_data = get_post_meta($post->ID,'time_field_id',true);
echo $saved_data;
Clone this wiki locally