<?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: Map form field to custom field located in an Array</title>
		<link>https://legacy.forums.gravityhelp.com/topic/map-form-field-to-custom-field-located-in-an-array</link>
		<description>Gravity Support Forums Topic: Map form field to custom field located in an Array</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 03:15:36 +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/map-form-field-to-custom-field-located-in-an-array" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Map form field to custom field located in an Array"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/map-form-field-to-custom-field-located-in-an-array#post-31248</link>
			<pubDate>Sat, 30 Jul 2011 18:52:25 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">31248@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You're welcome.  Glad you got it sorted out.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Annie Wendlick on "Map form field to custom field located in an Array"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/map-form-field-to-custom-field-located-in-an-array#post-31244</link>
			<pubDate>Sat, 30 Jul 2011 15:35:27 +0000</pubDate>
			<dc:creator>Annie Wendlick</dc:creator>
			<guid isPermaLink="false">31244@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks, I was able to figure out what the problem was. I just messed something up. (Go figure.)&#60;/p&#62;
&#60;p&#62;Anyway, thanks for the code! It was perfect.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Map form field to custom field located in an Array"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/map-form-field-to-custom-field-located-in-an-array#post-31243</link>
			<pubDate>Sat, 30 Jul 2011 14:59:16 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">31243@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You place that in your functions.php.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F&#34; rel=&#34;nofollow&#34;&#62;http://gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Be sure you change the ID of both the form and the field number for your value.  Also, please post what is happening to you now, a link to your site and the actual code you're using. Error messages too, if you have any.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Annie Wendlick on "Map form field to custom field located in an Array"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/map-form-field-to-custom-field-located-in-an-array#post-31241</link>
			<pubDate>Sat, 30 Jul 2011 14:22:13 +0000</pubDate>
			<dc:creator>Annie Wendlick</dc:creator>
			<guid isPermaLink="false">31241@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This looks like exactly what I need. I can adapt that snippet for something else I'm doing.&#60;/p&#62;
&#60;p&#62;Where do I put that code, though? Does something like that go in my theme's functions.php file? Or should I put that in a plugin that I'm modifying?&#60;/p&#62;
&#60;p&#62;I've tried it in both places, and it isn't working. I could have another error, too, I'm sure&#60;/p&#62;
&#60;p&#62;Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Map form field to custom field located in an Array"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/map-form-field-to-custom-field-located-in-an-array#post-29144</link>
			<pubDate>Tue, 05 Jul 2011 13:54:02 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">29144@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;What you will need to do is manually update the custom field using the gform_post_submission hook.&#60;br /&#62;
Following is a code snippet to get you started.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_post_submission&#38;quot;, &#38;quot;add_custom_field&#38;quot;, 10, 2);
function add_custom_field($entry, $form){
    //NOTE: replace 1 with the ID of your form.
    if($form[&#38;quot;id&#38;quot;] != 1)
       return;

    //getting post meta
    $meta = get_post_meta($entry[&#38;quot;post_id&#38;quot;], &#38;#39;key&#38;#39;, true);

    //updating price property of array.
    //NOTE: replace &#38;quot;1&#38;quot; with the ID of the field you want to populate the price field.
    $meta[&#38;quot;price&#38;quot;] = $entry[&#38;quot;1&#38;quot;];

    //updating meta
    update_post_meta($entry[&#38;quot;post_id&#38;quot;], &#38;quot;key&#38;quot;, $meta);

}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Kurt on "Map form field to custom field located in an Array"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/map-form-field-to-custom-field-located-in-an-array#post-28518</link>
			<pubDate>Fri, 24 Jun 2011 18:01:36 +0000</pubDate>
			<dc:creator>Kurt</dc:creator>
			<guid isPermaLink="false">28518@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for your answer Alex,&#60;/p&#62;
&#60;p&#62;I have a custom post type with several metaboxes, this metabxoxes feature several custom fields that are populated in an array  like the one above described above and it is based on this code: &#60;a href=&#34;http://brassblogs.com/cms-platforms/wordpress/custom-write-panels-for-wordpress-3-0&#34; rel=&#34;nofollow&#34;&#62;http://brassblogs.com/cms-platforms/wordpress/custom-write-panels-for-wordpress-3-0&#60;/a&#62;.&#60;/p&#62;
&#60;p&#62;I'm using custom post type + Gravity Forms plugin and everything works great  with taxonomies and the actual post type, the form is posting to the right place.&#60;/p&#62;
&#60;p&#62;I only have problems with the custom fields, because they are in an array, I call them like this n a regular post page:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$fields = get_post_meta($post-&#38;gt;ID, &#38;#39;key&#38;#39;, true);  (where key = the $meta_boxes  array)&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then to get the value of let's say that Price custom field in that array and display it in my website I just do this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;echo $fields[&#38;#39;price&#38;#39;];&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;And everything works great.&#60;/p&#62;
&#60;p&#62;Now in my Gravity form I drag a &#34;custom field&#34;  field to the form and go to Advanced properties and goto &#34;Custom field name&#34;-&#38;gt; Existing and the only thing I see there is &#34;Key&#34; that it is the array containing my custom fields but not the actual custom fields, and if i add a new one and name it price it does not work either, i just need to know how I map a Gravity Forms custom field in advanced properties to a custom field inside an array like this one, I need to map one input text like that and several dropdowns,&#60;br /&#62;
I really appreciate your help and let me know if you need me to explain it better.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Map form field to custom field located in an Array"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/map-form-field-to-custom-field-located-in-an-array#post-28508</link>
			<pubDate>Fri, 24 Jun 2011 16:17:35 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">28508@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am a little confused on what you are trying to do. Are you trying to populate a Post Custom Field with values from your array? Would it be a drop down field? Can you be a little more specific on exactly what you are trying to accomplish?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Kurt on "Map form field to custom field located in an Array"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/map-form-field-to-custom-field-located-in-an-array#post-28495</link>
			<pubDate>Fri, 24 Jun 2011 13:18:50 +0000</pubDate>
			<dc:creator>Kurt</dc:creator>
			<guid isPermaLink="false">28495@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have an array for a metabox like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$meta_boxes = array(
&#38;quot;featured&#38;quot; =&#38;gt; array(
	  &#38;quot;name&#38;quot; =&#38;gt; &#38;quot;featured&#38;quot;,
	  &#38;quot;title&#38;quot; =&#38;gt; $options[&#38;#39;featuredtext&#38;#39;],
	 &#38;quot;description&#38;quot; =&#38;gt; &#38;quot;&#38;quot;,
	  &#38;quot;type&#38;quot; =&#38;gt; &#38;quot;radio&#38;quot;,
	  &#38;quot;class&#38;quot; =&#38;gt; &#38;quot;radio&#38;quot;,
	  &#38;quot;rows&#38;quot; =&#38;gt; &#38;quot;&#38;quot;,
	  &#38;quot;width&#38;quot; =&#38;gt; &#38;quot;&#38;quot;,
	  &#38;quot;options&#38;quot; =&#38;gt; array(&#38;quot;1&#38;quot; =&#38;gt; &#38;quot;Yes&#38;quot;, &#38;quot;2&#38;quot; =&#38;gt; &#38;quot;No&#38;quot;, )
	),
         &#38;quot;price&#38;quot; =&#38;gt; array(
	  &#38;quot;name&#38;quot; =&#38;gt; &#38;quot;price&#38;quot;,
	  &#38;quot;title&#38;quot; =&#38;gt; $options[&#38;#39;pricetext&#38;#39;],
	  &#38;quot;description&#38;quot; =&#38;gt; &#38;quot;&#38;quot;,
	  &#38;quot;type&#38;quot; =&#38;gt; &#38;quot;text&#38;quot;,
	  &#38;quot;class&#38;quot; =&#38;gt; &#38;quot;text&#38;quot;,
	  &#38;quot;rows&#38;quot; =&#38;gt; &#38;quot;&#38;quot;,
	  &#38;quot;width&#38;quot; =&#38;gt; &#38;quot;&#38;quot;,
         &#38;quot;options&#38;quot; =&#38;gt; &#38;quot;&#38;quot;
	), )&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;And several more  values, can somebody guide me or help me with mapping a custom field in a regular form to one of this &#34;price&#34; or &#34;featured&#34; custom fields?  &#60;/p&#62;
&#60;p&#62;When I click on the dropdown of custom fields available the mentioned fields are not available there and I'm afraid that this is happening because they are inside the array.&#60;/p&#62;
&#60;p&#62;I'll appreciate and help with this as it seems simple but I cannot find a way to populate the fields.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
