<?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: can the hooks examples work with multiple forms?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/can-the-hooks-examples-work-with-multiple-forms</link>
		<description>Gravity Support Forums Topic: can the hooks examples work with multiple forms?</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 16:30:57 +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/can-the-hooks-examples-work-with-multiple-forms" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "can the hooks examples work with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-the-hooks-examples-work-with-multiple-forms#post-1555</link>
			<pubDate>Tue, 17 Nov 2009 18:32:00 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">1555@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;panmanphil,&#60;br /&#62;
gform_pre_submission won't help you in this situation.&#60;br /&#62;
To change post data, you want to use gform_post_data or gform_post_submission.&#60;br /&#62;
Do you still have a problem with gform_post_data not firing even though you have the post title field in the form?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>panmanphil on "can the hooks examples work with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-the-hooks-examples-work-with-multiple-forms#post-1544</link>
			<pubDate>Tue, 17 Nov 2009 11:40:51 +0000</pubDate>
			<dc:creator>panmanphil</dc:creator>
			<guid isPermaLink="false">1544@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I do have a post title and post body field on my form. I will hide with that snippet though. I am playin with gform_pre_submission hook with them as I write this. &#60;/p&#62;
&#60;p&#62;How would I get a link to a file uploaded with a file upload field in this form?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "can the hooks examples work with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-the-hooks-examples-work-with-multiple-forms#post-1542</link>
			<pubDate>Tue, 17 Nov 2009 11:14:25 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">1542@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ok. The code you have is correct.&#60;br /&#62;
The problem is that the filter only fires if you have a post field on the form. In your case, you don't. So what we are gonna have to do is add a post title field to the form and hide it with CSS. In the advanced tab, you can set the CSS Class property to &#34;post_title_hidden&#34; and then add the following to your theme's CSS&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
.post_title_hidden{display:none}&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>panmanphil on "can the hooks examples work with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-the-hooks-examples-work-with-multiple-forms#post-1541</link>
			<pubDate>Tue, 17 Nov 2009 10:54:57 +0000</pubDate>
			<dc:creator>panmanphil</dc:creator>
			<guid isPermaLink="false">1541@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I can't seem to get it to fire. My form id is one, the form tag named gform_1. I tried the changing the second number to 1 also. I also named the function to match the text in the add_filter call. The version I have is &#60;/p&#62;
&#60;p&#62;add_filter(&#34;gform_post_data_1&#34;, &#34;set_post_info&#34;, 10, 2); //replace 2 with your form id&#60;br /&#62;
function set_post_info($post_data, $form){&#60;br /&#62;
    $post_data[&#34;post_title&#34;] = $_POST[&#34;input_14&#34;]; //replace input_1 with your hidden $field name&#60;br /&#62;
    $post_data[&#34;post_content&#34;] = $_POST[&#34;input_13&#34;]; //replace input2 with your hidden field name&#60;br /&#62;
    return $post_data;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;I am just learning all this but it seems like add_filter fires before the user enters data. If so that wouldn't help in my case because I'm trying to get data the user has entered.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>panmanphil on "can the hooks examples work with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-the-hooks-examples-work-with-multiple-forms#post-1538</link>
			<pubDate>Tue, 17 Nov 2009 09:45:45 +0000</pubDate>
			<dc:creator>panmanphil</dc:creator>
			<guid isPermaLink="false">1538@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This looks like it may be perfect. I'll let you know.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "can the hooks examples work with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-the-hooks-examples-work-with-multiple-forms#post-1528</link>
			<pubDate>Mon, 16 Nov 2009 21:16:26 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">1528@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Some hooks pass the Form meta object to the function, and you can add an if statement to run the code for a specific form (i.e. if($form[&#34;id&#34;] == 1) .....)&#60;/p&#62;
&#60;p&#62;In your case, you will want to use the gform_post_data filter. That filter also has an equivalent gform_post_data_FORMID that can be used to filter a specific form. The following code seems be what you need.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
add_filter(&#34;gform_post_data_2&#34;, &#34;set_post_info&#34;, 10, 2);     //replace 2 with your form id&#60;br /&#62;
function custom_taxonomy($post_data, $form){&#60;br /&#62;
	$post_data[&#34;post_title&#34;] = $_POST[&#34;input_1&#34;]; //replace input_1 with your hidden field name&#60;br /&#62;
	$post_data[&#34;post_content&#34;] = $_POST[&#34;input_2&#34;] //replace input2 with your hidden field name&#60;br /&#62;
	return $post_data;&#60;br /&#62;
}&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>panmanphil on "can the hooks examples work with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-the-hooks-examples-work-with-multiple-forms#post-1521</link>
			<pubDate>Mon, 16 Nov 2009 18:00:19 +0000</pubDate>
			<dc:creator>panmanphil</dc:creator>
			<guid isPermaLink="false">1521@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;As I read the code snippets for using hooks, like gform_post_submission, can these actually work if you have more than one form? As suggested in another thread I wanted to populate a hidden Post Title and Post Body field, and a hook seems a reasonable way to do it. But if I add another form, it seems it would blow up because of the hook.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
