<?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: Price field dynamically populated by WP custom field</title>
		<link>https://legacy.forums.gravityhelp.com/topic/price-field-dynamically-populated-by-wp-custom-field</link>
		<description>Gravity Support Forums Topic: Price field dynamically populated by WP custom field</description>
		<language>en-US</language>
		<pubDate>Sun, 05 Apr 2026 12:14:13 +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/price-field-dynamically-populated-by-wp-custom-field" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Price field dynamically populated by WP custom field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/price-field-dynamically-populated-by-wp-custom-field#post-344098</link>
			<pubDate>Tue, 25 Jun 2013 10:27:37 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">344098@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alejandro, you can use the gform_pre_render filter to populate fields in your form.  Here is the documentation for the filter: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_pre_render&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_pre_render&#60;/a&#62;&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
&#38;lt;?php
// change the 7 here to your actual form ID
add_filter(&#38;#39;gform_pre_render_7&#38;#39;, &#38;#39;populate_price&#38;#39;);
function populate_price($form) {
	// documentation: &#60;a href=&#34;http://bit.ly/15C2BQu&#34; rel=&#34;nofollow&#34;&#62;http://bit.ly/15C2BQu&#60;/a&#62;
	// get the price from the custom field for this post
	$price = get_post_meta(get_the_ID(), &#38;#39;Precio&#38;#39;, true);

	// set the value of your product price to the value which was retrieved
	if ($field[&#38;#39;id&#38;#39;] == 1) {
		$field[&#38;#39;price&#38;#39;] = $price;
	}

	// always return the modified form
	return $form;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That code will go in your theme's functions.php file and will need to be customized for the form ID (I used 7) and the field ID (I used 1). I used &#34;Precio&#34; for the meta key.  That will need to match exactly as well.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Aejandro on "Price field dynamically populated by WP custom field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/price-field-dynamically-populated-by-wp-custom-field#post-337287</link>
			<pubDate>Fri, 21 Jun 2013 18:49:12 +0000</pubDate>
			<dc:creator>Aejandro</dc:creator>
			<guid isPermaLink="false">337287@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello, please how can a GF price field be dynamically populated with a WP custom field?&#60;/p&#62;
&#60;p&#62;The WP custom field IS in the post where the form is embedded.&#60;/p&#62;
&#60;p&#62;Here you have a link to a post with a GF. The WP custom field is &#34;Precio&#34;:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://goo.gl/HNH7D&#34; rel=&#34;nofollow&#34;&#62;http://goo.gl/HNH7D&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thank you very much.&#60;/p&#62;
&#60;p&#62;Thank you very much
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
