<?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: Modify Post Data (Title) on Submission</title>
		<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission</link>
		<description>Gravity Support Forums Topic: Modify Post Data (Title) on Submission</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 03:24:07 +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/modify-post-data-title-on-submission" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-66477</link>
			<pubDate>Mon, 16 Jul 2012 11:46:50 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">66477@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Cathy, can you echo the value of $entry[&#34;7&#34;] to see what it contains? Be sure you are targetting the right field?&#60;/p&#62;
&#60;p&#62;Alternately, can you change the conditional to something that will always be TRUE, so you can be certain the code is processed no matter what the $entry object contains?  This will make sure your function is being processed.  &#60;/p&#62;
&#60;p&#62;We need to start at the beginning and figure out where the problem lies.  Thanks.&#60;/p&#62;
&#60;p&#62;If you'd like to export the complete form I can install your form and then see how your function works.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>UMW Webmaster on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-66473</link>
			<pubDate>Mon, 16 Jul 2012 11:39:52 +0000</pubDate>
			<dc:creator>UMW Webmaster</dc:creator>
			<guid isPermaLink="false">66473@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Oops, I meant to mention: My ultimate goal is for the post title to be a concatenation of several other form field values, but, for testing purposes, I'm just using a string right now. &#60;/p&#62;
&#60;p&#62;The title I'm getting when I use this function is just &#34;Untitled.&#34;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>UMW Webmaster on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-66469</link>
			<pubDate>Mon, 16 Jul 2012 11:38:36 +0000</pubDate>
			<dc:creator>UMW Webmaster</dc:creator>
			<guid isPermaLink="false">66469@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi David, &#60;/p&#62;
&#60;p&#62;I set up a test WP instance to try and work through this. I'm just using TwentyTen as my theme, so the functions.php file is the standard one for that theme, plus my custom function (at the bottom). You can see it here: &#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastebin.com/hq7Y67v2&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/hq7Y67v2&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;In addition, here's the XML (from the form export XML file) for field #7: &#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastebin.com/60AKftVP&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/60AKftVP&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Any ideas you have are appreciated!&#60;br /&#62;
Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-66428</link>
			<pubDate>Mon, 16 Jul 2012 09:58:28 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">66428@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Can you post your functions.php file on pastebin or something similar and link it so I can take a look? What kind of Post Title are you currently getting?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>UMW Webmaster on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-66424</link>
			<pubDate>Mon, 16 Jul 2012 09:46:10 +0000</pubDate>
			<dc:creator>UMW Webmaster</dc:creator>
			<guid isPermaLink="false">66424@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I don't know if it's kosher to bump a thread in here, but I'm wondering if anyone has any thoughts about why this code wouldn't be working (as a plugin or in functions.php).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>UMW Webmaster on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-65982</link>
			<pubDate>Thu, 12 Jul 2012 14:30:11 +0000</pubDate>
			<dc:creator>UMW Webmaster</dc:creator>
			<guid isPermaLink="false">65982@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay, I moved the code into functions.php, and it's still not working. The post gets created, but the title is not set correctly. &#60;/p&#62;
&#60;p&#62;One question: for the if statement where I'm testing the value of form field #7 ($entry['7']), should I be testing against the Label for the selection of the Value? I assumed Value and that's what the code above reflects. (I've actually tried both, and it doesn't seem to help.)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-65965</link>
			<pubDate>Thu, 12 Jul 2012 11:49:17 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">65965@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I understand, but the first step is to make sure your code is working as you expect before we try to move it out of the functions file :) Let me know if it works or doesn't.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>UMW Webmaster on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-65964</link>
			<pubDate>Thu, 12 Jul 2012 11:45:35 +0000</pubDate>
			<dc:creator>UMW Webmaster</dc:creator>
			<guid isPermaLink="false">65964@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ah! Okay. I can try putting it in functions. The site is a big, institutional multisite installation so functions is already a beast. That's why I was trying to avoid it. But I see what you mean.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-65962</link>
			<pubDate>Thu, 12 Jul 2012 11:34:45 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">65962@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Have you tried putting this in the functions.php file to see if it works before moving it to a plugin architecture? I am worried that it isn't being called because you are separating it from the normal hook system of Gravity Forms.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>UMW Webmaster on "Modify Post Data (Title) on Submission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modify-post-data-title-on-submission#post-65960</link>
			<pubDate>Thu, 12 Jul 2012 11:30:42 +0000</pubDate>
			<dc:creator>UMW Webmaster</dc:creator>
			<guid isPermaLink="false">65960@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm working on a form that creates a Post where I want the post title to be dynamically generated from a number of other form fields (essentially, the title is a tracking code made up of other codes generated by other fields). &#60;/p&#62;
&#60;p&#62;Using a content template on the Post Title does exactly what I want except for one thing: depending on the values a certain field (Form Field 7), the way the title is constructed changes. So I need to write a custom function that will create the Post Title based on some if statements. &#60;/p&#62;
&#60;p&#62;Due to the way my site is managed, I prefer to do this as a plugin rather than in the themes functions.php file. &#60;/p&#62;
&#60;p&#62;Here's what I've written: &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_post_data&#38;quot;, &#38;quot;create_proposal_title&#38;quot;, 10, 2);

function create_proposal_title($post_data, $entry) {

if ($entry[&#38;#39;7&#38;#39;] == &#38;#39;NEWPRG&#38;#39;) {
    $post_data[&#38;#39;post_title&#38;#39;] = $entry[&#38;#39;7&#38;#39;].&#38;quot;-&#38;quot;.$entry[&#38;#39;17&#38;#39;].&#38;quot;-&#38;quot;.$entry[&#38;#39;3&#38;#39;].&#38;quot;-&#38;quot;.$entry[&#38;#39;9&#38;#39;].&#38;quot;-&#38;quot;.$entry[&#38;#39;id&#38;#39;];

    }
    return $post_data;

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;However, this isn't working. I'm not sure what I'm doing incorrectly. Is there anything obvious with my syntax of use of the filter?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
