Date will not save – saves today instead.
-
I’m not seeing any other posts about this but it’s happening to me. I have a repeatable date + time metabox and I can enter the date/time and add a row to add another date/time, but when I save it the date/time changes to today’s date and a different time, and any other rows I created go away. It has worked perfectly in the past but no longer. Here’s what I’ve got right now:
$meta_boxes['event_metabox'] = array( 'id' => 'event_metabox', 'title' => __( 'Event Details', 'cmb2' ), 'object_types' => array( 'event', ), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array( array( 'name' => __( 'Date(s) & Time(s)', 'cmb2' ), 'desc' => __( 'Description', 'cmb2' ), 'id' => $prefix . 'date_time', 'type' => 'text_datetime_timestamp', 'repeatable' => true, ), ), );
On the frontend it shows today’s date and the random time it put in, unless I add another row, in which case it shows both today’s date and 1/1/1970.
I’ve used the exact same code, literally copy and pasted directly from another project, where it was working great but I’ve just checked and it isn’t working on that site anymore either. Please help! Could it be because of an update?
- The topic ‘Date will not save – saves today instead.’ is closed to new replies.