<?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: Targeting a specific form with gform_after_submission</title>
		<link>https://legacy.forums.gravityhelp.com/topic/targeting-a-specific-form-with-gform_after_submission</link>
		<description>Gravity Support Forums Topic: Targeting a specific form with gform_after_submission</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 18:32:23 +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/targeting-a-specific-form-with-gform_after_submission" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "Targeting a specific form with gform_after_submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/targeting-a-specific-form-with-gform_after_submission#post-57948</link>
			<pubDate>Mon, 07 May 2012 08:45:13 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">57948@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If you want to target just that form, you'll want to use:&#60;br /&#62;
gform_after_submission_3 then you don't need to have your if statement and it should work fine.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>snails007 on "Targeting a specific form with gform_after_submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/targeting-a-specific-form-with-gform_after_submission#post-57845</link>
			<pubDate>Sat, 05 May 2012 01:47:31 +0000</pubDate>
			<dc:creator>snails007</dc:creator>
			<guid isPermaLink="false">57845@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have a form (form id 3) embedded on a single post page and I am wanting it, once submitted, to publish the post that was just submitted and then change the post status of the single post that I am on to 'draft'.&#60;/p&#62;
&#60;p&#62;This works perfectly except that also I have 2 other forms on the site and the code below is targeting another form. So when the other form is submitted on it's page it is also changing the status of the page it is on to 'draft'.&#60;/p&#62;
&#60;p&#62;I only want to change the status to draft when I am using form number 3. What have I done wrong??&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Action to change post status of project to draft after being selected
add_action(&#38;quot;gform_after_submission&#38;quot;, &#38;quot;set_post_content&#38;quot;, 10, 2);
function set_post_content($form){

	//only for form id
    if($form[&#38;quot;id&#38;quot;] == 3)
       return $form;

    //getting post
    $post = get_post($post-&#38;gt;ID);

    //changing post content
    $post-&#38;gt;post_status  = &#38;quot;draft&#38;quot;;

    //updating post
    wp_update_post($post);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
