Skip to content
bainternet edited this page Apr 23, 2013 · 2 revisions

#Input Field

To add a Date Picker field to your metabox simply use the addDate method of the metabox object:

    $my_meta =  new AT_Meta_Box($config);
    $my_meta->addDate('date_field_id',array('name'=> 'My Date'));`

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' => // date format, default yy-mm-dd. Optional. Default "'d MM, yy'"  See more formats here: http://goo.gl/Wcwxn
        
  • reapeater: When adding this field to a repeater block set to true (default false)

Get Field Data:

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