<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Combining fields</title>
		<link>https://legacy.forums.gravityhelp.com/topic/combining-fields</link>
		<description>Gravity Support Forums Topic: Combining fields</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 00:42:17 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/combining-fields" rel="self" type="application/rss+xml" />

		<item>
			<title>letuslook on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-22764</link>
			<pubDate>Fri, 08 Apr 2011 05:33:04 +0000</pubDate>
			<dc:creator>letuslook</dc:creator>
			<guid isPermaLink="false">22764@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;hi benjamin, could you please explain how you managene to get this working properly?&#60;/p&#62;
&#60;p&#62;thanks,&#60;/p&#62;
&#60;p&#62;Luc
&#60;/p&#62;</description>
		</item>
		<item>
			<title>skilfullycurled on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-21873</link>
			<pubDate>Mon, 28 Mar 2011 18:53:38 +0000</pubDate>
			<dc:creator>skilfullycurled</dc:creator>
			<guid isPermaLink="false">21873@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;doh! could an admin please delete?&#60;/p&#62;
&#60;p&#62;lo siento.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>skilfullycurled on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-21872</link>
			<pubDate>Mon, 28 Mar 2011 18:50:24 +0000</pubDate>
			<dc:creator>skilfullycurled</dc:creator>
			<guid isPermaLink="false">21872@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi everyone,&#60;/p&#62;
&#60;p&#62;I am trying to create a form to submit to a custom post type that has The Events Calendar metabox.  I am able to get all of the variables into the post except the date and time. I am using a variation of alex's code which I have put in my theme's functions.php file.&#60;/p&#62;
&#60;p&#62;The form I am using has custom post fields of date and time type for the start and end dates and times respectively.  The form also has two custom post fields of type hidden.  I will work to get the form online so it can be inspected.  Currently I am editing locally and using GF 1.5.&#60;/p&#62;
&#60;p&#62;Many thanks for your help the help of all those who attacked this problem before me!&#60;/p&#62;
&#60;p&#62;Benjamin&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastebin.com/embed_js.php?i=wVwkeQjk&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/embed_js.php?i=wVwkeQjk&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Extrememuz on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-10464</link>
			<pubDate>Tue, 28 Sep 2010 06:05:52 +0000</pubDate>
			<dc:creator>Extrememuz</dc:creator>
			<guid isPermaLink="false">10464@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The tut looks cool, I've got nearly every thing except something really simple.&#60;/p&#62;
&#60;p&#62;Where do the fields below go in Gravity Forms.&#60;/p&#62;
&#60;p&#62;_isEvent (make this “1″)&#60;br /&#62;
_EventVenue&#60;br /&#62;
_EventCost&#60;br /&#62;
_EventStartDate (2010-05-20 09:00:00)&#60;br /&#62;
_EventEndDate (2010-05-20 17:00:00)&#60;br /&#62;
_EventPhone&#60;br /&#62;
_EventCountry (United States)&#60;br /&#62;
_EventState (AZ)&#60;br /&#62;
_EventCity&#60;br /&#62;
_EventProvince (???)&#60;br /&#62;
_EventZip&#60;br /&#62;
_EventShowMapLink&#60;br /&#62;
_EventAllDay (make this “yes” if it’s a full day event)&#60;br /&#62;
_EventAddress&#60;/p&#62;
&#60;p&#62;Thanks in advance Muz!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Samantha on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-10322</link>
			<pubDate>Fri, 24 Sep 2010 17:14:46 +0000</pubDate>
			<dc:creator>Samantha</dc:creator>
			<guid isPermaLink="false">10322@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I am interested in using the date picker as well. Thank you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sriganesh on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-10067</link>
			<pubDate>Sun, 19 Sep 2010 12:45:42 +0000</pubDate>
			<dc:creator>sriganesh</dc:creator>
			<guid isPermaLink="false">10067@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@brianfidler&#60;/p&#62;
&#60;p&#62;Thanks for the tutorial.&#60;br /&#62;
It works perfectly.&#60;/p&#62;
&#60;p&#62;Btw, could you explain how to change the code if I was to use date picker in the gravity form.&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>brianfidler on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-9974</link>
			<pubDate>Thu, 16 Sep 2010 16:10:55 +0000</pubDate>
			<dc:creator>brianfidler</dc:creator>
			<guid isPermaLink="false">9974@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've got this code to work for Gravity Forms v1.3 and The Events Calendar. At the end I've also got a snippet to format the post_name from the post_title for the pretty URL. Also, my date and times are both in an array because i'm using the Date Field rather than the Date Picker in Gravity Forms.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//GravityForms Modifications
//change post type for Events to sp_events for Event Posting form
add_filter(&#38;quot;gform_post_data&#38;quot;, &#38;quot;change_post_type&#38;quot;, 10, 2);
function change_post_type($post_data, $form){

    if($form[&#38;quot;id&#38;quot;] == &#38;#39;5&#38;#39;){
        $post_data[&#38;quot;post_type&#38;quot;] = &#38;quot;sp_events&#38;quot;;
    }
    return $post_data;
}

//convert date and time to Events Calendar style for Event Posting form
add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;format_event_date&#38;quot;);
function format_event_date($form){

    //replace 5 with your actual form id
    if($form[&#38;quot;id&#38;quot;] != 5)
    	return;

    //replace input_5 and input_6 with your actual date field IDs
    $startDate = $_POST[&#38;quot;input_5&#38;quot;];
    $endDate = $_POST[&#38;quot;input_6&#38;quot;];

    //replace input_23 and input_24 with your actual time field IDs
    $startTime = $_POST[&#38;quot;input_23&#38;quot;];
    $endTime = $_POST[&#38;quot;input_24&#38;quot;];

    $eventStartDate = $startDate[2] . &#38;quot;-&#38;quot; . $startDate[0] . &#38;quot;-&#38;quot; . $startDate[1] . &#38;quot; &#38;quot; . $startTime[0] . &#38;quot;:&#38;quot; . $startTime[1].$startTime[2];

    $eventEndDate = $endDate[2] . &#38;quot;-&#38;quot; . $endDate[0] . &#38;quot;-&#38;quot; . $endDate[1] . &#38;quot; &#38;quot; . $endTime[0] . &#38;quot;:&#38;quot; . $endTime[1].$endTime[2];

    $eventStartDate = strtotime($eventStartDate);
    $eventEndDate = strtotime($eventEndDate);

    //formatting date
    $formatted_start_date = strftime(&#38;quot;%Y-%m-%d %H:%M:%S&#38;quot;, $eventStartDate);
    $formatted_end_date = strftime(&#38;quot;%Y-%m-%d %H:%M:%S&#38;quot;, $eventEndDate);

    //replace with the IDs of the hidden fields that will hold the formatted dates
    $_POST[&#38;quot;input_5&#38;quot;] = $formatted_start_date;
    $_POST[&#38;quot;input_6&#38;quot;] = $formatted_end_date;
}

add_action(&#38;quot;gform_post_submission&#38;quot;, &#38;quot;add_EventDatesAndTimes&#38;quot;, 10, 2);
function add_EventDatesAndTimes($entry, $form) {
    update_post_meta($entry[&#38;#39;post_id&#38;#39;], &#38;quot;_EventStartDate&#38;quot;, $_POST[&#38;quot;input_5&#38;quot;]);
    update_post_meta($entry[&#38;#39;post_id&#38;#39;], &#38;quot;_EventEndDate&#38;quot;, $_POST[&#38;quot;input_6&#38;quot;]);
}

add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;create_friendly_url&#38;quot;);
function create_friendly_url()
{
	 $phrase = $_POST[&#38;#39;title&#38;#39;];
	 $maxLength = 200;
    $result = strtolower($phrase);

    $result = preg_replace(&#38;quot;/[^a-z0-9\s-]/&#38;quot;, &#38;quot;&#38;quot;, $result);
    $result = trim(preg_replace(&#38;quot;/[\s-]+/&#38;quot;, &#38;quot; &#38;quot;, $result));
    $result = trim(substr($result, 0, $maxLength));
    $result = preg_replace(&#38;quot;/\s/&#38;quot;, &#38;quot;-&#38;quot;, $result);

    $_POST[&#38;quot;postname&#38;quot;] = $formatted_dateend;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>brianfidler on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-9934</link>
			<pubDate>Wed, 15 Sep 2010 20:48:29 +0000</pubDate>
			<dc:creator>brianfidler</dc:creator>
			<guid isPermaLink="false">9934@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@creativeslice I'm not sure because I haven't uploaded v1.4 yet, but it looks like you'll need to alter the last two lines from:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$_POST[&#38;quot;eventstartdate&#38;quot;] = $formatted_date;
$_POST[&#38;quot;eventenddate&#38;quot;] = $formatted_dateend;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;to...&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$_POST[&#38;quot;_EventStartDate&#38;quot;] = $formatted_date;
$_POST[&#38;quot;_EventEndDate&#38;quot;] = $formatted_dateend;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Tim Bowen on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-9695</link>
			<pubDate>Fri, 10 Sep 2010 13:45:51 +0000</pubDate>
			<dc:creator>Tim Bowen</dc:creator>
			<guid isPermaLink="false">9695@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;With the new version of Gravity Forms you can now name fields which makes this hack much easier.  However I'm running into an issue where the Start and End dates are not being passed to the Events UNLESS an editor goes in an manually unchecks the &#34;All day event?&#34; box and then publishes the post.  Otherwise the date data is lost and it defaults to 1970.  Any ideas how to fix this?  I'm using this code in my functions file:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;format_event_date&#38;quot;);
function format_event_date($form){

    //replace 1 with your actual form id
    if($form[&#38;quot;id&#38;quot;] != 4)
        return;

    //replace 4 with your actual date field ID
    $date = $_POST[&#38;quot;eventday&#38;quot;];

    //replace with your actual time field ID
    $time = $_POST[&#38;quot;starttime&#38;quot;];
    $timeend = $_POST[&#38;quot;endtime&#38;quot;];

    $hour = str_pad($time[0], 2, &#38;quot;0&#38;quot;, STR_PAD_LEFT); //making sure hour has 2 digits
    $minute = str_pad($time[1], 2, &#38;quot;0&#38;quot;, STR_PAD_LEFT); //making sure minutes has 2 digits

    $hourend = str_pad($timeend[0], 2, &#38;quot;0&#38;quot;, STR_PAD_LEFT); //making sure hour has 2 digits
    $minuteend = str_pad($timeend[1], 2, &#38;quot;0&#38;quot;, STR_PAD_LEFT); //making sure minutes has 2 digits

    //formatting date
    $raw_date = &#38;quot;{$date} {$hour}:{$minute}{$time[2]}&#38;quot;;
    $formatted_date = gmdate(&#38;quot;Y-m-d H:i:s&#38;quot;, strtotime($raw_date));

    $raw_dateend = &#38;quot;{$date} {$hourend}:{$minuteend}{$timeend[2]}&#38;quot;;
    $formatted_dateend = gmdate(&#38;quot;Y-m-d H:i:s&#38;quot;, strtotime($raw_dateend));

    //replace with the IDs of the hidden fields that will hold the formatted dates
    $_POST[&#38;quot;eventstartdate&#38;quot;] = $formatted_date;
    $_POST[&#38;quot;eventenddate&#38;quot;] = $formatted_dateend;

 }&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Smith on "Combining fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/combining-fields#post-8247</link>
			<pubDate>Thu, 05 Aug 2010 10:49:51 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">8247@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If you want to send me FTP access to your WP install, I will take a look: &#60;a href=&#34;mailto:david@ounceoftalent.com&#34;&#62;david@ounceoftalent.com&#60;/a&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
