<?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: save_post wordpress hook with gravityforms</title>
		<link>https://legacy.forums.gravityhelp.com/topic/save_post-wordpress-hook-with-gravityforms</link>
		<description>Gravity Support Forums Topic: save_post wordpress hook with gravityforms</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 01:50:05 +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/save_post-wordpress-hook-with-gravityforms" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "save_post wordpress hook with gravityforms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save_post-wordpress-hook-with-gravityforms#post-23755</link>
			<pubDate>Wed, 20 Apr 2011 12:19:59 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">23755@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Glad you were able to figure out and glad Gravity Forms is serving you well! :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dennispedrie on "save_post wordpress hook with gravityforms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save_post-wordpress-hook-with-gravityforms#post-23744</link>
			<pubDate>Wed, 20 Apr 2011 11:14:59 +0000</pubDate>
			<dc:creator>dennispedrie</dc:creator>
			<guid isPermaLink="false">23744@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I figured it out. :)&#60;/p&#62;
&#60;p&#62;Problem with field names, and the $_POST['post_type'] like you said.&#60;/p&#62;
&#60;p&#62;Thanks.&#60;/p&#62;
&#60;p&#62;Fantastic plugin, btw. Absolute lifesaver.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "save_post wordpress hook with gravityforms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save_post-wordpress-hook-with-gravityforms#post-23710</link>
			<pubDate>Tue, 19 Apr 2011 17:07:45 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">23710@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Unless you're adding $_POST['post_type'] into the $_POST before the save_post action is fired, it probably is not available in the $_POST. Here is print_r of what was available in the $_POST when the save_post action was fired on my localhost:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;{&#38;quot;input_1&#38;quot;:&#38;quot;Test&#38;quot;,&#38;quot;input_2&#38;quot;:&#38;quot;Test&#38;quot;,&#38;quot;input_3&#38;quot;:&#38;quot;http:\/\/&#38;quot;,&#38;quot;input_10&#38;quot;:&#38;quot;&#38;quot;,&#38;quot;input_11&#38;quot;:&#38;quot;&#38;quot;,&#38;quot;is_submit_39&#38;quot;:&#38;quot;1&#38;quot;,&#38;quot;gform_submit&#38;quot;:&#38;quot;39&#38;quot;,&#38;quot;gform_unique_id&#38;quot;:&#38;quot;4dadf6b88beea&#38;quot;,&#38;quot;state_39&#38;quot;:&#38;quot;YToyOntpOjA7czo2OiJhOjA6e30iO2k6MTtzOjMyOiJjM2Q2MTc3MWFiODc5MGExODg3YTAwYmI1NzNmYmZjNSI7fQ==&#38;quot;,&#38;quot;gform_target_page_number_39&#38;quot;:&#38;quot;0&#38;quot;,&#38;quot;gform_source_page_number_39&#38;quot;:&#38;quot;1&#38;quot;,&#38;quot;gform_field_values&#38;quot;:&#38;quot;&#38;quot;}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>dennispedrie on "save_post wordpress hook with gravityforms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save_post-wordpress-hook-with-gravityforms#post-23637</link>
			<pubDate>Mon, 18 Apr 2011 19:54:23 +0000</pubDate>
			<dc:creator>dennispedrie</dc:creator>
			<guid isPermaLink="false">23637@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I did a bit more digging. The hook gets fired, but I'm getting caught up on my post type checking.&#60;/p&#62;
&#60;p&#62;I added a function to my site to allow Gforms to add content to a post type called &#34;bloggers&#34;. This works fine.&#60;/p&#62;
&#60;p&#62;I have the following code in my save_post function to make sure I'm only getting the right post type. This is where my problem is. The function gets returned before any of the important stuff happens.&#60;/p&#62;
&#60;p&#62;How can I change this code to allow Gforms to get through my validation?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// verify if this is an auto save routine. If it is our form has not been submitted, so we dont want
	// to do anything
	if ( defined(&#38;#39;DOING_AUTOSAVE&#38;#39;) &#38;amp;&#38;amp; DOING_AUTOSAVE )
		return $post_id;

	// Check permissions
	if ( &#38;#39;bloggers&#38;#39; == $_POST[&#38;#39;post_type&#38;#39;] ) {
		if ( !current_user_can( &#38;#39;edit_page&#38;#39;, $post_id ) )
			return $post_id;
	}
	else
		return $post_id;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Smith on "save_post wordpress hook with gravityforms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save_post-wordpress-hook-with-gravityforms#post-23606</link>
			<pubDate>Mon, 18 Apr 2011 16:35:23 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">23606@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Dennis,&#60;/p&#62;
&#60;p&#62;I did some tests locally and the save_post hook was fired successfully when creating a new post with Gravity Forms. Could you post the function you are firing on save_post?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dennispedrie on "save_post wordpress hook with gravityforms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save_post-wordpress-hook-with-gravityforms#post-23596</link>
			<pubDate>Mon, 18 Apr 2011 15:37:37 +0000</pubDate>
			<dc:creator>dennispedrie</dc:creator>
			<guid isPermaLink="false">23596@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've got a function to automatically create a taxonomy entry when I create or edit a post. It's called using the save_post hook in WordPress, and works perfectly on the backend.&#60;/p&#62;
&#60;p&#62;It doesn't work in Gforms though, &#60;strike&#62;and I'm assuming based on that that Gforms doesn't use WordPress' built-in post creation functions.&#60;/strike&#62;&#60;/p&#62;
&#60;p&#62;I found in forms_model.php that gforms uses the wp_insert_post() function, which does call the save_post hook. Why doesn't it seem to be working right then?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
