<?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: Post Custom Field Default Value Altered in DB</title>
		<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db</link>
		<description>Gravity Support Forums Topic: Post Custom Field Default Value Altered in DB</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 21:44:49 +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/post-custom-field-default-value-altered-in-db" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Post Custom Field Default Value Altered in DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db#post-80027</link>
			<pubDate>Wed, 10 Oct 2012 08:30:36 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">80027@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That's a good way to do it.  Thanks for the update.&#60;/p&#62;
&#60;p&#62;Here is a link to the topic for reference:&#60;br /&#62;
&#60;a href=&#34;http://wpquestions.com/question/showLoggedIn/id/7393&#34; rel=&#34;nofollow&#34;&#62;http://wpquestions.com/question/showLoggedIn/id/7393&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Post Custom Field Default Value Altered in DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db#post-79703</link>
			<pubDate>Mon, 08 Oct 2012 17:20:37 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">79703@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I was able to get a solution on wpquestions using gform_post_submission and then unserialize() to update the post meta. Thanks for your help pointing me in the right direction!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Post Custom Field Default Value Altered in DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db#post-79218</link>
			<pubDate>Fri, 05 Oct 2012 23:59:52 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">79218@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I don't think I would unserialize it before storing it in Gravity Forms, since Gravity Forms expects it to be serialized.  If you leave the storage alone, can you unserialize it before Woo gets hold of the value?  They expect the data in a certain format, and you have that, but it's just encapsulated as one big string by Gravity Forms.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Post Custom Field Default Value Altered in DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db#post-78963</link>
			<pubDate>Thu, 04 Oct 2012 17:24:57 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">78963@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I think there may be a way to do that, but I need a little guidance with using the the two functions. There is a wp function called maybe_unserialize( ) that should hypothetically fix this, I just need to use the two gf functions properly. Here is what I tried:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_save_field_value_8&#38;quot;, &#38;quot;save_field_value&#38;quot;, 10, 4);
function save_field_value($value, $lead, $field, $form){
           return   maybe_unserialize( $value );
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;And&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_save_field_value_8&#38;quot;, &#38;quot;save_field_value&#38;quot;, 10, 4);
function save_field_value($value, $lead, $field, $form){
    if($field[&#38;quot;id&#38;quot;] == 8){
            maybe_unserialize( $value );
	}
return $value;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;It didn't work though, could it be serializing it after this hook?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Post Custom Field Default Value Altered in DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db#post-78763</link>
			<pubDate>Wed, 03 Oct 2012 17:51:11 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">78763@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Looks like Gravity Forms is serializing the serialized data, which is why you see the s:440 there.  It serialized the whole value.  Gravity Forms is going to serialize any default value you enter.  You are going to need a way to unserialize it before Woo gets hold of it.  What functions does woo have available for modifying the value before using it?  In Gravity Forms, we would use gform_pre_render to change the value before displaying it, when displaying the form anyway.  &#60;/p&#62;
&#60;p&#62;You might be able to integrate gform_save_field_value to change the value before saving it, but I think that will create other problems.  Maybe better if you can use gform_get_field_value and modifying the value before sending it to Woo?&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_save_field_value&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_save_field_value&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_get_field_value&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_get_field_value&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The issue is that Gravity Forms is serializing the default value, like it would serialize any value entered there. Gravity Forms does not know your value is already serialized.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Post Custom Field Default Value Altered in DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db#post-78748</link>
			<pubDate>Wed, 03 Oct 2012 16:51:52 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">78748@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I don't believe it involves Woo too much, it seems to be something with how GF is storing the information. It is essentially a custom post type being created, and I am inserting the value with a custom field. Here are some screenshots to walk through&#60;/p&#62;
&#60;p&#62;Here is the meta I am trying to store in a custom field for the new post:&#60;br /&#62;
&#60;a href=&#34;http://imgur.com/5RZ6Q&#34; rel=&#34;nofollow&#34;&#62;http://imgur.com/5RZ6Q&#60;/a&#62;&#60;br /&#62;
This is the meta for the custom field used by the Woo gf add-on&#60;/p&#62;
&#60;p&#62;So I make this custom field box:&#60;br /&#62;
&#60;a href=&#34;http://imgur.com/5wxJu&#34; rel=&#34;nofollow&#34;&#62;http://imgur.com/5wxJu&#60;/a&#62;&#60;br /&#62;
And insert that meta from above as the default value:&#60;br /&#62;
&#60;a href=&#34;http://imgur.com/LoyPB&#34; rel=&#34;nofollow&#34;&#62;http://imgur.com/LoyPB&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://imgur.com/t0a6q&#34; rel=&#34;nofollow&#34;&#62;http://imgur.com/t0a6q&#60;/a&#62; (of course I normally hide that)&#60;/p&#62;
&#60;p&#62;However, when I then use the form GF creates this as the meta value in the db:&#60;br /&#62;
&#60;a href=&#34;http://imgur.com/BwewR&#34; rel=&#34;nofollow&#34;&#62;http://imgur.com/BwewR&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Post Custom Field Default Value Altered in DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db#post-78744</link>
			<pubDate>Wed, 03 Oct 2012 16:33:19 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">78744@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;We don't have any specific information about integration with Woocommerce. Are you adding the products through Woocommerce?  Are you writing and storing that serialized value yourself? And is this erroneous information being stored in the Gravity Forms tables (rg_)?&#60;/p&#62;
&#60;p&#62;Can you show how you are doing things now?  Maybe we can spot the problem.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Post Custom Field Default Value Altered in DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db#post-78705</link>
			<pubDate>Wed, 03 Oct 2012 15:04:04 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">78705@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Anyone?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ktrusak on "Post Custom Field Default Value Altered in DB"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-custom-field-default-value-altered-in-db#post-77550</link>
			<pubDate>Wed, 26 Sep 2012 18:42:13 +0000</pubDate>
			<dc:creator>ktrusak</dc:creator>
			<guid isPermaLink="false">77550@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am using a GF to create Woocommerce products from the frontend. I am storing some of the information to set the defaults for the product inside of the form with post custom field inputs and putting the info in the default value. This worked for all fields except one complex value, which keeps having erroneous meta inserted around it inside the db&#60;/p&#62;
&#60;p&#62;The value I am putting in is&#60;br /&#62;
&#60;code&#62;a:13:{s:2:&#38;quot;id&#38;quot;;s:2:&#38;quot;21&#38;quot;;s:13:&#38;quot;display_title&#38;quot;;s:0:&#38;quot;&#38;quot;;s:19:&#38;quot;display_description&#38;quot;;s:0:&#38;quot;&#38;quot;;s:25:&#38;quot;disable_woocommerce_price&#38;quot;;s:3:&#38;quot;yes&#38;quot;;s:12:&#38;quot;price_before&#38;quot;;s:0:&#38;quot;&#38;quot;;s:11:&#38;quot;price_after&#38;quot;;s:0:&#38;quot;&#38;quot;;s:20:&#38;quot;disable_calculations&#38;quot;;s:3:&#38;quot;yes&#38;quot;;s:22:&#38;quot;disable_label_subtotal&#38;quot;;s:3:&#38;quot;yes&#38;quot;;s:21:&#38;quot;disable_label_options&#38;quot;;s:3:&#38;quot;yes&#38;quot;;s:19:&#38;quot;disable_label_total&#38;quot;;s:3:&#38;quot;yes&#38;quot;;s:14:&#38;quot;label_subtotal&#38;quot;;s:8:&#38;quot;Subtotal&#38;quot;;s:13:&#38;quot;label_options&#38;quot;;s:7:&#38;quot;Options&#38;quot;;s:11:&#38;quot;label_total&#38;quot;;s:5:&#38;quot;Total&#38;quot;;}&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;but it is appearing inside this:  s:440:&#34;here&#34;; any ideas why this is happening?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
