<?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: Merge tag bug when using pre render</title>
		<link>https://legacy.forums.gravityhelp.com/topic/merge-tag-bug-when-using-pre-render</link>
		<description>Gravity Support Forums Topic: Merge tag bug when using pre render</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 15:06:57 +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/merge-tag-bug-when-using-pre-render" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Merge tag bug when using pre render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/merge-tag-bug-when-using-pre-render#post-203472</link>
			<pubDate>Wed, 10 Apr 2013 04:05:38 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">203472@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I heard back from the development team.&#60;/p&#62;
&#60;p&#62;You need to use both the &#34;gform_pre_render&#34; and &#34;gform_admin_pre_render&#34; hooks to populate the radio button; the hooks can use the same function. If only the gform_pre_render is used, the form object will not have the new radio button choices and will still be using the default First Choice, Second Choice, etc. behind the scenes. This will cause the merge tags to not be replaced. I tested this out on my system and once I added in the gform_admin_pre_render, went into the admin and saved, my form object had what is needed and could match things up correctly to replace the merge tags.&#60;/p&#62;
&#60;p&#62;Does that help?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Josh on "Merge tag bug when using pre render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/merge-tag-bug-when-using-pre-render#post-201411</link>
			<pubDate>Mon, 08 Apr 2013 15:13:43 +0000</pubDate>
			<dc:creator>Josh</dc:creator>
			<guid isPermaLink="false">201411@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Cool thanks Chris.&#60;/p&#62;
&#60;p&#62;Be interesting to see what they say.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Merge tag bug when using pre render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/merge-tag-bug-when-using-pre-render#post-201363</link>
			<pubDate>Mon, 08 Apr 2013 14:13:39 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">201363@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'll bring this to the attention of the development team for their feedback.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Josh on "Merge tag bug when using pre render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/merge-tag-bug-when-using-pre-render#post-196413</link>
			<pubDate>Thu, 04 Apr 2013 07:04:29 +0000</pubDate>
			<dc:creator>Josh</dc:creator>
			<guid isPermaLink="false">196413@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I've noticed a bug with merge tags - not sure if you are aware or if someone can explain why this is not woking as it should.&#60;/p&#62;
&#60;p&#62;I have a radio field labelled 'Item' with the field id 19&#60;/p&#62;
&#60;p&#62;Usually to ouput this data as merge tags I would simply do this...&#60;/p&#62;
&#60;p&#62;choice text {Item:19}&#60;br /&#62;
choice value {Item:19:value}&#60;/p&#62;
&#60;p&#62;Simples. The above merge tags work.&#60;/p&#62;
&#60;p&#62;But when using pre-render php, for example...&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$products = get_field(&#38;#39;item_information&#38;#39;,$post-&#38;gt;ID);
$items = array();
foreach($products as $product)
	$items[] = array(
		&#38;quot;text&#38;quot; =&#38;gt; $product[&#38;#39;order_description&#38;#39;],
		&#38;quot;value&#38;quot; =&#38;gt; $product[&#38;#39;price_euro&#38;#39;]
	);
foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field){
    if($field[&#38;quot;id&#38;quot;] == 19 ){
        $field[&#38;quot;choices&#38;quot;] = $items;
        $field[&#38;quot;label&#38;quot;] = get_the_title($post-&#38;gt;ID);
    }
}
return $form;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;If I then use these merge tags...&#60;/p&#62;
&#60;p&#62;choice text {Item:19}&#60;br /&#62;
choice value {Item:19:value}&#60;/p&#62;
&#60;p&#62;They both output the value. Which is incorrect because the choice text should not the choice value.&#60;/p&#62;
&#60;p&#62;Any ideas why this behaviour happens?&#60;/p&#62;
&#60;p&#62;Thanks&#60;br /&#62;
Josh
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
