I’ve built a custom post type called “Events”. Each event has a future date and I don’t want to use the normal postdate
of the post.
I want to use add_meta_box
to add some inputs for this “event-date”.
Do you have any idea how I could use the probably same date-picker as there is right now for the postdate
in a meta_box?
Thank you in advance.
matt
update:
add_action("admin_init", "admin_init");
function admin_init(){
add_meta_box("event-date-meta", "Event Date", "event_date", "wr_event", "side", "low");
}
function year_completed(){
global $post;
$custom = get_post_custom($post->ID);
//â¦
?>
<label>Event-Date:</label>
<div id="timestampdiv" class=""><?php touch_time(($action == 'edit'),1,4); ?></div>
<?php
}
Never really thought about it, but it should indeed be a good option.
The date picker is called from wp-admin/includes/meta-boxes.php (line 183) as:
and touch_time() is defined in wp-admin/includes/template.php (line 550) as:
Doesn’t look very difficult to work it from there… will try.