<?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 Tag: gform_post_submission - Recent Posts</title>
		<link>https://legacy.forums.gravityhelp.com/tags/gform_post_submission</link>
		<description>Gravity Support Forums Tag: gform_post_submission - Recent Posts</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 18:28:58 +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/tags/gform_post_submission" rel="self" type="application/rss+xml" />

		<item>
			<title>Thomas Kot on "How do you debug ?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-do-you-debug#post-249841</link>
			<pubDate>Mon, 13 May 2013 00:48:14 +0000</pubDate>
			<dc:creator>Thomas Kot</dc:creator>
			<guid isPermaLink="false">249841@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The link is not working..&#60;br /&#62;
 I am trying to debug and show up the print_r from the hook call for the $form object and the $entry object.&#60;/p&#62;
&#60;p&#62;Please help... Urgent
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Pre Render a Taxonomy Checlist, then update post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-a-taxonomy-checlist-then-update-post#post-193765</link>
			<pubDate>Tue, 02 Apr 2013 00:13:07 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">193765@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Rather create a string to create a CSV of all your terms, I think I would loop through every 3.* entry, and add it to an array (I thought you mentioned previously that it could be an array or CSV). There's no need to type out every field ID and add it manually to a string like that.  You could also use a loop and build the string, rather than type out each input field like that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Pre Render a Taxonomy Checlist, then update post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-a-taxonomy-checlist-then-update-post#post-193666</link>
			<pubDate>Mon, 01 Apr 2013 22:52:23 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">193666@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay so doing it manually worked, but isn't ideal:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$terms = $entry[&#38;quot;3.1&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.2&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.3&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.4&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.5&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.6&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.7&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.8&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.9&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.10&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.11&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.12&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.13&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.14&#38;quot;].&#38;#39;, &#38;#39;.$entry[&#38;quot;3.15&#38;quot;];

   wp_set_post_terms($thenumber, $terms, &#38;#39;product_category&#38;#39; );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Is there anyway around this?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Pre Render a Taxonomy Checlist, then update post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-a-taxonomy-checlist-then-update-post#post-193643</link>
			<pubDate>Mon, 01 Apr 2013 22:21:30 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">193643@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;It is a checkbox field so it submitting numeric values for the selection
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Pre Render a Taxonomy Checlist, then update post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-a-taxonomy-checlist-then-update-post#post-193203</link>
			<pubDate>Mon, 01 Apr 2013 15:04:35 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">193203@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You need to &#60;strong&#62;make&#60;/strong&#62; $entry['3'] an array or CSV?  What does $entry['3'] contain when the form is first submitted?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Pre Render a Taxonomy Checlist, then update post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-a-taxonomy-checlist-then-update-post#post-193067</link>
			<pubDate>Mon, 01 Apr 2013 12:51:04 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">193067@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay I was able to get everything pretty close to done. The only problem is that for wp_set_post_terms I need the $entry[&#34;3&#34;] to be an array or csv. Any ideas how to do that?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Pre Render a Taxonomy Checlist, then update post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-a-taxonomy-checlist-then-update-post#post-192991</link>
			<pubDate>Mon, 01 Apr 2013 11:56:10 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">192991@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay, I switched over to after submission&#60;/p&#62;
&#60;p&#62;I was able to get the pre-render to work (kind of) using in_array and isSelected. So it appears correctly, however once I did this now GF is not recognizing and submissions from the field, the entry object is always empty.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_after_submission_2&#38;#39;, &#38;#39;GF_update_product&#38;#39;);
function GF_update_product ($entry) {

  global $wpdb, $post;

  $thenumber = $_GET[&#38;#39;kr_id&#38;#39;];

	$tripdesc = array();
	$tripdesc[&#38;#39;ID&#38;#39;] =  $thenumber;
	$tripdesc[&#38;#39;post_content&#38;#39;] = $entry[&#38;quot;2&#38;quot;];
	$tripdesc[&#38;#39;post_title&#38;#39;] = $entry[&#38;quot;1&#38;quot;];
	wp_update_post ( $tripdesc );

   __update_post_meta($thenumber, &#38;#39;mp_price&#38;#39;, $entry[&#38;quot;4&#38;quot;]);
   __update_post_meta($thenumber, &#38;#39;mp_shipping&#38;#39;, $entry[&#38;quot;5&#38;quot;]);

	$terms = $entry[&#38;quot;3&#38;quot;];
	foreach($terms as $term){
		wp_set_post_terms($thenumber, $term, &#38;#39;product_category&#38;#39; );
	}
}

add_filter(&#38;#39;gform_pre_render_2&#38;#39;, &#38;#39;populate_each_product2&#38;#39;);
function populate_each_product2 ($form){

global $post, $wpdb;

$id = $_GET[&#38;#39;kr_id&#38;#39;];

if(!empty($id)){

        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){
            if($field[&#38;quot;id&#38;quot;] == 1){
                $field[&#38;quot;defaultValue&#38;quot;] = get_the_title($id);
            }

            if($field[&#38;quot;id&#38;quot;] == 2){
                $field[&#38;quot;defaultValue&#38;quot;] = get_post_field(&#38;#39;post_content&#38;#39;, $id);
            }

            if($field[&#38;quot;id&#38;quot;] == 4){
                $field[&#38;quot;defaultValue&#38;quot;] = get_post_meta($id, &#38;#39;mp_price&#38;#39;, TRUE);
            }

            if($field[&#38;quot;id&#38;quot;] == 5){
                $field[&#38;quot;defaultValue&#38;quot;] = get_post_meta($id, &#38;#39;mp_shipping&#38;#39;, TRUE);
            }

            if($field[&#38;quot;id&#38;quot;] == 3){
            	$args = array( &#38;#39;hide_empty&#38;#39; =&#38;gt; false, );
            	$cats = get_terms(&#38;#39;product_category&#38;#39;, $args);
            	$field[&#38;#39;choices&#38;#39;] = array();
            	foreach ($cats as $cat){
			$name =  $cat-&#38;gt;name;
			$val  =  $cat-&#38;gt;term_id;
			$term_list = wp_get_post_terms($id, &#38;#39;product_category&#38;#39;, array(&#38;quot;fields&#38;quot; =&#38;gt; &#38;quot;ids&#38;quot;));
			if (in_array($val, $term_list)) { $select = true;} else { $select = false; }

				$field[&#38;#39;choices&#38;#39;][] = array( &#38;#39;text&#38;#39; =&#38;gt; $name, &#38;#39;value&#38;#39; =&#38;gt; $val, &#38;#39;isSelected&#38;#39; =&#38;gt; $select);

                }
            }

         }

    return $form;

    }
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Pre Render a Taxonomy Checlist, then update post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-a-taxonomy-checlist-then-update-post#post-192016</link>
			<pubDate>Sun, 31 Mar 2013 20:30:19 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">192016@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I think I would add some debug statements to your code to see where this is failing.  We should tackle one problem at a time.  How about the post_submission first, since it will be easiest?  &#60;/p&#62;
&#60;p&#62;First of all, you should use gform_after_submission since gform_post_submission has been deprecated.&#60;/p&#62;
&#60;p&#62;Second, I would add some debug statements.  Add &#34;echo $id;&#34; on line 7 and see what it contains.  Dump the $entry array on line 3, like this &#34;print_r($entry);&#34; to see what it contains.&#60;/p&#62;
&#60;p&#62;Then, take a look at your code on line 8.  You set $entry['3'] to a empty array, but then you try to iterate over it on line 9.  That code will never do anything and will probably throw an exception since the array is empty when you try to iterate over the array items.&#60;/p&#62;
&#60;p&#62;Can you explain what you're trying to do with the loop which begins on line 9?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Pre Render a Taxonomy Checlist, then update post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-render-a-taxonomy-checlist-then-update-post#post-189260</link>
			<pubDate>Fri, 29 Mar 2013 10:52:02 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">189260@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am having trouble populating a checklist with the checked values of a post, and then update the terms after submission. The post being edited is sent to the form by query string, and I did fine getting the name and values for the taxonomy in the form. However, everything I have tried for checking boxes and the setting post terms hasn't worked, wondering if anyone knows what I am doing wrong?&#60;/p&#62;
&#60;p&#62;Here is the pre-render with just the taxonomy and values, I tried using, wp_get_post_terms and differnt ways to get the checked values in, but couldn't&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_pre_render_2&#38;#39;, &#38;#39;populate_each_product&#38;#39;);
function populate_each_product ($form){
global $post, $wpdb;
$id = $_GET[&#38;#39;kr_id&#38;#39;];
if(!empty($id)){
        foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){
            if($field[&#38;quot;id&#38;quot;] == 3){
            	$args = array( &#38;#39;hide_empty&#38;#39; =&#38;gt; false, );
            	$cats = get_terms(&#38;#39;product_category&#38;#39;, $args);
            	$field[&#38;#39;choices&#38;#39;] = array();
            	foreach ($cats as $cat){
			 $name =  $cat -&#38;gt; name;
			 $val =  $cat -&#38;gt; term_id;
        	         $field[&#38;#39;choices&#38;#39;][] = array( &#38;#39;text&#38;#39; =&#38;gt; $name,&#38;#39;value&#38;#39; =&#38;gt; $val);
                }
            }
         }
    return $form;
    }
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;As far as post submission I have tried tons of different ways to get it to set_post_Terms but couldn't get anything to work&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_post_submission_2&#38;#39;, &#38;#39;GF_update_product&#38;#39;);
function GF_update_product ($entry) {

  global $wpdb, $post;

  $id= $_GET[&#38;#39;kr_id&#38;#39;];

   $entry[&#38;quot;3&#38;quot;] = array();
   foreach($entry[&#38;quot;3&#38;quot;]-&#38;gt;value as $term){
      wp_set_post_terms($id, $term, &#38;#39;product_category&#38;#39; );
   }

}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Submitting to WHMCS after registration"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/submitting-to-whmcs-after-registration#post-146141</link>
			<pubDate>Tue, 12 Feb 2013 01:39:16 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">146141@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The gform_post_submission hook was deprecated.  Please change to gform_after_submission.&#60;/p&#62;
&#60;p&#62;I don't see anything obviously wrong with that code.  Can you add some debugging echoes or print_r statements along the way to see if the arrays contain what you think they should right after you assign the values?   I would print_r the $entry and also the $fields, possibly the $data as well.&#60;/p&#62;
&#60;p&#62;I'm assuming that the form ID 3 is correct and all the field IDs are correct as well.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
