<?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: Function call and $field_values</title>
		<link>https://legacy.forums.gravityhelp.com/topic/function-call-and-field_values</link>
		<description>Gravity Support Forums Topic: Function call and $field_values</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 00:58:30 +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/function-call-and-field_values" rel="self" type="application/rss+xml" />

		<item>
			<title>sascha on "Function call and $field_values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/function-call-and-field_values#post-46712</link>
			<pubDate>Wed, 18 Jan 2012 11:33:28 +0000</pubDate>
			<dc:creator>sascha</dc:creator>
			<guid isPermaLink="false">46712@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there,&#60;br /&#62;
I do not understand the $field_values in the the above example. I could not find anything in the documentation yet either. Can the $field_values also be used when calling a form by shortcode? Would I use $field_values to pre-populate fields?&#60;/p&#62;
&#60;p&#62;How would I set a form up, so that it does not create a post, but uses the wp_update_post function instead?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Function call and $field_values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/function-call-and-field_values#post-22647</link>
			<pubDate>Wed, 06 Apr 2011 14:47:40 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">22647@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Conceptually, all you'd need to do is conditionally use the &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_disable_post_creation&#34; rel=&#34;nofollow&#34;&#62;gform_disable_post_creation&#60;/a&#62; hook to disable post creation when the user is editing through the Gravity Form. This would be a condition that would need to be created and checked in your own custom code.&#60;/p&#62;
&#60;p&#62;If the user is in &#34;edit&#34; mode, you can then use a combination of the &#60;a href=&#34;http://codex.wordpress.org/Function_Reference/wp_update_post&#34; rel=&#34;nofollow&#34;&#62;wp_update_post&#60;/a&#62; function (to update the post title, post body, etc) and &#60;a href=&#34;http://codex.wordpress.org/Function_Reference/update_post_meta&#34; rel=&#34;nofollow&#34;&#62;update_post_meta&#60;/a&#62; function (to update the post meta).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Fredrik-s on "Function call and $field_values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/function-call-and-field_values#post-22645</link>
			<pubDate>Wed, 06 Apr 2011 14:06:07 +0000</pubDate>
			<dc:creator>Fredrik-s</dc:creator>
			<guid isPermaLink="false">22645@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That worked fine.&#60;/p&#62;
&#60;p&#62;I have a following question due. &#60;/p&#62;
&#60;p&#62;The above code is suppose to be in a form where the visitors can write a review (post body of post) if there is none written (post body). I have a connection to a custom post type (through the available fix Gravity Forms + Custom Post Types). &#60;/p&#62;
&#60;p&#62;Example:&#60;br /&#62;
Title: Toyota Supra&#60;br /&#62;
Post body: Not-written-yet&#60;br /&#62;
Field values: Type=Car, Color=Red, Speed=Fast&#60;/p&#62;
&#60;p&#62;As you can se above example should be able to be updated through a form. I do a check with a if-expression to se if the post body is empty (this works fine showing the form). In above example this is the case. &#60;/p&#62;
&#60;p&#62;So I show a form (Gravity form) and the visitor could write a review into the post body. I take all the other values and send with through hidden fields. &#60;/p&#62;
&#60;p&#62;But when I sign this form up it will not update the old one, instead showing up like a copy beside the other. &#60;/p&#62;
&#60;p&#62;How can I do to update the existing post with just the post body that the visitor have written?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Function call and $field_values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/function-call-and-field_values#post-22634</link>
			<pubDate>Wed, 06 Apr 2011 12:25:46 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">22634@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there, the issue is that the $field_values parameter should be defined before the $ajax parameter. Let me know if that does the trick.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Fredrik-s on "Function call and $field_values"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/function-call-and-field_values#post-22603</link>
			<pubDate>Wed, 06 Apr 2011 03:25:28 +0000</pubDate>
			<dc:creator>Fredrik-s</dc:creator>
			<guid isPermaLink="false">22603@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I'm trying to use the function call -way to import a form into a Wordpress theme page. This works great with:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;gravity_form(
		3,
		$display_title=false,
		$display_description=true,
		$display_inactive=false,
		$ajax=true,
		$field_values = array(
			&#38;#39;namn&#38;#39;=&#38;gt;$namn,
			&#38;#39;url&#38;#39;=&#38;gt;$url,
			&#38;#39;vanlig_url&#38;#39;=&#38;gt;$vanlig_url,
			&#38;#39;typ&#38;#39;=&#38;gt;$typ,
			&#38;#39;registrering&#38;#39;=&#38;gt;$registrering,
			&#38;#39;kategori&#38;#39;=&#38;gt;$kategori)
		);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;As you also can se I'm trying to add field values through the $field_values command. And here it's where I bump into problem. &#60;/p&#62;
&#60;p&#62;Nothing want show up in the hidden fields which I added when creating the form. The hidden fields are set to the following:&#60;/p&#62;
&#60;p&#62;&#34;Allow field to be populated dynamically&#34; is checked&#60;br /&#62;
&#34;Parameter Name:&#34; is set to the six seen above in the code&#60;br /&#62;
Label name is also set to the six seen above in the code&#60;/p&#62;
&#60;p&#62;The parameters $namn, $url, $vanlig_url, $typ, $registrering, $kategori are all checked and the output the information I want in my hidden fields.&#60;/p&#62;
&#60;p&#62;The source code which is being output looks like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;li id=&#38;#39;field_3_3&#38;#39; class=&#38;#39;gfield     gform_hidden&#38;#39; &#38;gt;
&#38;lt;input name=&#38;#39;input_3&#38;#39; id=&#38;#39;input_3_3&#38;#39; type=&#38;#39;hidden&#38;#39; class=&#38;#39;gform_hidden&#38;#39; value=&#38;#39;&#38;#39; /&#38;gt;

&#38;lt;li id=&#38;#39;field_3_4&#38;#39; class=&#38;#39;gfield     gform_hidden&#38;#39; &#38;gt;
&#38;lt;input name=&#38;#39;input_4&#38;#39; id=&#38;#39;input_3_4&#38;#39; type=&#38;#39;hidden&#38;#39; class=&#38;#39;gform_hidden&#38;#39; value=&#38;#39;&#38;#39; /&#38;gt;

&#38;lt;li id=&#38;#39;field_3_5&#38;#39; class=&#38;#39;gfield     gform_hidden&#38;#39; &#38;gt;
&#38;lt;input name=&#38;#39;input_5&#38;#39; id=&#38;#39;input_3_5&#38;#39; type=&#38;#39;hidden&#38;#39; class=&#38;#39;gform_hidden&#38;#39; value=&#38;#39;&#38;#39; /&#38;gt;

&#38;lt;li id=&#38;#39;field_3_6&#38;#39; class=&#38;#39;gfield     gform_hidden&#38;#39; &#38;gt;
&#38;lt;input name=&#38;#39;input_6&#38;#39; id=&#38;#39;input_3_6&#38;#39; type=&#38;#39;hidden&#38;#39; class=&#38;#39;gform_hidden&#38;#39; value=&#38;#39;&#38;#39; /&#38;gt;

&#38;lt;li id=&#38;#39;field_3_7&#38;#39; class=&#38;#39;gfield     gform_hidden&#38;#39; &#38;gt;
&#38;lt;input name=&#38;#39;input_7&#38;#39; id=&#38;#39;input_3_7&#38;#39; type=&#38;#39;hidden&#38;#39; class=&#38;#39;gform_hidden&#38;#39; value=&#38;#39;&#38;#39; /&#38;gt;

&#38;lt;li id=&#38;#39;field_3_8&#38;#39; class=&#38;#39;gfield     gform_hidden&#38;#39; &#38;gt;
&#38;lt;input name=&#38;#39;input_8&#38;#39; id=&#38;#39;input_3_8&#38;#39; type=&#38;#39;hidden&#38;#39; class=&#38;#39;gform_hidden&#38;#39; value=&#38;#39;&#38;#39; /&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;What am I doing wrong? And how to solve it?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
