<?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: gform_post_data filter not firing</title>
		<link>https://legacy.forums.gravityhelp.com/topic/gform_post_data-filter-not-firing</link>
		<description>Gravity Support Forums Topic: gform_post_data filter not firing</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 10:21:28 +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/gform_post_data-filter-not-firing" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "gform_post_data filter not firing"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_post_data-filter-not-firing#post-41018</link>
			<pubDate>Mon, 14 Nov 2011 10:42:23 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">41018@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for the update and for sharing your solution.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Nirav on "gform_post_data filter not firing"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_post_data-filter-not-firing#post-41008</link>
			<pubDate>Mon, 14 Nov 2011 10:01:42 +0000</pubDate>
			<dc:creator>Nirav</dc:creator>
			<guid isPermaLink="false">41008@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have solved the problem, the form needs to have atleast one of the post related field on the form (you can add a hideme class to hide using jQuery it if you don't need it), then only it triggers the code to save it in custom post type.&#60;/p&#62;
&#60;p&#62;I have this code working now:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;quot;gform_post_data&#38;quot;, &#38;quot;ft_gf_change_post_type&#38;quot;, 10, 2 );

function ft_gf_change_post_type( $post_data, $form ) {
	$does_form_saves_as_post = false;

	foreach ( $form[&#38;quot;fields&#38;quot;] as $field ) {
		if ( in_array( $field[&#38;quot;type&#38;quot;], array( &#38;quot;post_category&#38;quot;, &#38;quot;post_title&#38;quot;, &#38;quot;post_content&#38;quot;, &#38;quot;post_excerpt&#38;quot;, &#38;quot;post_tags&#38;quot;, &#38;quot;post_custom_fields&#38;quot;, &#38;quot;post_image&#38;quot; ) ) )
			$does_form_saves_as_post = true;
	}

	if ( $does_form_saves_as_post )
		$post_data[&#38;#39;post_type&#38;#39;] = &#38;#39;job&#38;#39;;

	return $post_data;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Nirav on "gform_post_data filter not firing"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform_post_data-filter-not-firing#post-40992</link>
			<pubDate>Mon, 14 Nov 2011 06:41:50 +0000</pubDate>
			<dc:creator>Nirav</dc:creator>
			<guid isPermaLink="false">40992@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am trying to change the post type of the form data but it seems like &#60;code&#62;gform_post_data&#60;/code&#62; is not firing at all. The file is included while execution i.e. a &#60;code&#62;die()&#60;/code&#62; in the file halts everything but inside the function nothing is executed, so I think &#60;code&#62;gform_post_data&#60;/code&#62; filter is not even firing on my setup.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;quot;gform_post_data&#38;quot;, &#38;quot;ft_gf_change_post_type&#38;quot;, 10, 2 );

function ft_gf_change_post_type( $post_data, $form ) {
	$post_data[&#38;quot;post_type&#38;quot;] = &#38;quot;job&#38;quot;;
	return $post_data;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Also on Gist: &#60;a href=&#34;https://gist.github.com/1363676&#34; rel=&#34;nofollow&#34;&#62;https://gist.github.com/1363676&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;P.S. I have gone through the forums a lot, the same filter is working for everyone but not me. Any suggestions what could be failing here?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
