<?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 function not firing on user-submitted posts</title>
		<link>https://legacy.forums.gravityhelp.com/topic/save_post-function-not-firing-on-user-submitted-posts</link>
		<description>Gravity Support Forums Topic: Save_post function not firing on user-submitted posts</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:37:26 +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-function-not-firing-on-user-submitted-posts" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Save_post function not firing on user-submitted posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save_post-function-not-firing-on-user-submitted-posts#post-68486</link>
			<pubDate>Sun, 29 Jul 2012 23:24:01 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">68486@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for the update.  Glad that worked for you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>moreslack on "Save_post function not firing on user-submitted posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save_post-function-not-firing-on-user-submitted-posts#post-68442</link>
			<pubDate>Sun, 29 Jul 2012 12:07:25 +0000</pubDate>
			<dc:creator>moreslack</dc:creator>
			<guid isPermaLink="false">68442@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Nevermind. Looks like the solution was to use gform_post_submission instead of save_post. My guess is that the default setting for the post was overriding the save_post action. The following did the trick&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission&#38;quot;, &#38;quot;set_post_categories&#38;quot;, 10, 2);

function set_post_categories($entry, $form){
   //getting post
    $post = get_post($entry[&#38;quot;post_id&#38;quot;]);

   //$entry[11] and $entry[12] correspond to the two custom fields that we&#38;#39;re mapping to categories
    $cat_ids = array($entry[11],  $entry[12]);
    wp_set_object_terms( $post_id, $cat_ids, &#38;#39;category&#38;#39;);

   //updating post
    wp_update_post($post);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>moreslack on "Save_post function not firing on user-submitted posts"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/save_post-function-not-firing-on-user-submitted-posts#post-68440</link>
			<pubDate>Sun, 29 Jul 2012 11:35:43 +0000</pubDate>
			<dc:creator>moreslack</dc:creator>
			<guid isPermaLink="false">68440@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hey there,&#60;br /&#62;
I have a similar issue as the open request at:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/add_action-upon-post-published-with-custom-field&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/add_action-upon-post-published-with-custom-field&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;We have added an action to the &#34;save_post&#34; action to update the post category based on values saved on two custom post fields (we need to support two different searching methods, hence the duplication of info on a single post). The code below works when we save a post through the admin UI:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function update_category($post_id ) {
$cat_ids = array( get_post_meta($post_id, place_type, true) , get_post_meta($post_id, location, true) );
wp_set_object_terms( $post_id, $cat_ids, &#38;#39;category&#38;#39;);
}
add_action(&#38;#39;save_post&#38;#39;, &#38;#39;update_category&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;However, when the post is created through the Gravity Form submission, the custom fields are populated based on two questions mapped to those two fields, but the corresponding categories aren't updated. Opening the post as an admin and simply click &#34;Update&#34; without applying any changes causes the action to fire. Any idea what we might be doing wrong here?&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
