Hi Guys,
I'm sure I'm doing this wrong, but I'm stuck.
I'm using pre_submission_filter to change the value of a hidden field to an array.
$time = array( 'hours' => 2);
$post_data['post_custom_fields']['_DURATION'] = $time;
The problem is if I don't serialize the $time then _DURATION is set to 2 (the value of the first key in $time). If I do serialize $time then _DURATION is set to s:26;"a:1:{5:"hours;s:1"2";}"; (a serialized string of my serialized array :)
Like I said, I'm sure I'm doing something really really wrong here, but I'm going mad trying to figure this one out.
Can anyone help?