Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom post type Events.

Under Events, I have a custom meta box which selects the time and data of the event:

<?php
$meta_boxes[] = array(
'id'         => 'event_date_option',
'title'      => __('Event date'),
'pages'      => 'events',
'context'    => 'normal',
'priority'   => 'high',
'show_names' => true,
'fields'     => array(
    array(
        'name' => __('Event Date'),
        'desc' => __('When will the event happen'),
        'id'   => '_event_date',
        'type' => 'text_date',
    ),
    array(
        'name' => __('Event Time'),
        'desc' => __('What time will the event start'),
        'id'   => '_event_time',
        'type' => 'text_time',
    ),
),
);
?>

How can I save the date and time in a different table in my WP database when the admin clicks "Publish" or "Update"?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.