<?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: pre-populate - understanding code example</title>
		<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-understanding-code-example</link>
		<description>Gravity Support Forums Topic: pre-populate - understanding code example</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 09:37:48 +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/pre-populate-understanding-code-example" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "pre-populate - understanding code example"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-understanding-code-example#post-46010</link>
			<pubDate>Tue, 10 Jan 2012 17:23:59 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">46010@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;&#60;a href=&#34;http://en.wikipedia.org/wiki/There's_more_than_one_way_to_do_it&#34; rel=&#34;nofollow&#34;&#62;There's more than one way to do it&#60;/a&#62; :-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sascha on "pre-populate - understanding code example"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-understanding-code-example#post-46007</link>
			<pubDate>Tue, 10 Jan 2012 17:16:32 +0000</pubDate>
			<dc:creator>sascha</dc:creator>
			<guid isPermaLink="false">46007@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ok, thought that the \ was for that. Have not called the function direct yet. Never seen the create_function used before, but it works.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "pre-populate - understanding code example"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-understanding-code-example#post-46002</link>
			<pubDate>Tue, 10 Jan 2012 17:06:52 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">46002@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The \ escapes the single quote.  Otherwise there would be a syntax error.&#60;/p&#62;
&#60;p&#62;Not sure on WHY he did it like that, but there are always multiple ways to accomplish the same thing, and this might be one of those cases.  Have you tried it by calling the function direct?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sascha on "pre-populate - understanding code example"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-understanding-code-example#post-45991</link>
			<pubDate>Tue, 10 Jan 2012 15:43:27 +0000</pubDate>
			<dc:creator>sascha</dc:creator>
			<guid isPermaLink="false">45991@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there,&#60;br /&#62;
the original topic (&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/right-parameter-names-to-pre-populate-the-names-fields&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/right-parameter-names-to-pre-populate-the-names-fields&#60;/a&#62;) is closed, so I started a new one to ask the question.&#60;/p&#62;
&#60;p&#62;I am trying to understand some code by David in the following pastie:&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/1470060&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1470060&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Why does he use the create_function here and not just call the function direct? Is there any reason for this?&#60;/p&#62;
&#60;p&#62;He uses:&#60;br /&#62;
add_filter('gform_field_value_user_firstname', create_function(&#34;&#34;, '$value = populate_usermeta(\'first_name\'); return $value;' ));&#60;/p&#62;
&#60;p&#62;I would have used:&#60;br /&#62;
add_filter('gform_field_value_user_firstname', 'populate_usermeta('first_name')');&#60;/p&#62;
&#60;p&#62;What are the \ before the ' for?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
