We're having 2 issues right now.
1) 4 posts are created when a new event is added. This problem is not occurring with other custom post types so we're pretty sure this is an Events Calendar Pro bug but would love to hear any insights you may have as to why this could happen.
2) We cannot get the date to be passed correctly in Events Calendar Pro. This was working perfectly before the Gravity Forms 1.5 update but we can't figure out what would have changed. Here is the code in the functions file which used to work:
add_action("gform_pre_submission", "format_event_date");
function format_event_date($form){
//replace 1 with your actual form id
if($form["id"] != 1)
return;
//replace 4 with your actual date field ID
$date = $_POST["input_6"];
$dateend = $_POST["input_8"];
//replace with your actual time field ID
$time = $_POST["input_7"];
$timeend = $_POST["input_9"];
$hour = str_pad($time[0], 2, "0", STR_PAD_LEFT); //making sure hour has 2 digits
$minute = str_pad($time[1], 2, "0", STR_PAD_LEFT); //making sure minutes has 2 digits
$hourend = str_pad($timeend[0], 2, "0", STR_PAD_LEFT); //making sure hour has 2 digits
$minuteend = str_pad($timeend[1], 2, "0", STR_PAD_LEFT); //making sure minutes has 2 digits
//formatting date
$raw_date = "{$date} {$hour}:{$minute}{$time[2]}";
$formatted_date = gmdate("Y-m-d H:i:s", strtotime($raw_date));
$raw_dateend = "{$dateend} {$hourend}:{$minuteend}{$timeend[2]}";
$formatted_dateend = gmdate("Y-m-d H:i:s", strtotime($raw_dateend));
//replace with the IDs of the hidden fields that will hold the formatted dates
$_POST["input_20"] = $formatted_date;
$_POST["input_21"] = $formatted_dateend;
}
Any help or pointing in the right direction would be greatly appreciated,
Thanks!
- Tim
Posted 13 years ago on Wednesday March 30, 2011 |
Permalink