<?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: Modifying data before inserting into user registration table.</title>
		<link>https://legacy.forums.gravityhelp.com/topic/modifying-data-before-inserting-into-user-registration-table</link>
		<description>Gravity Support Forums Topic: Modifying data before inserting into user registration table.</description>
		<language>en-US</language>
		<pubDate>Fri, 03 Apr 2026 19:42:19 +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/modifying-data-before-inserting-into-user-registration-table" rel="self" type="application/rss+xml" />

		<item>
			<title>BandonRandon on "Modifying data before inserting into user registration table."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modifying-data-before-inserting-into-user-registration-table#post-17799</link>
			<pubDate>Sun, 06 Feb 2011 22:19:38 +0000</pubDate>
			<dc:creator>BandonRandon</dc:creator>
			<guid isPermaLink="false">17799@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The issue was that I had to update my version of Gravity Forums on my production site.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>BandonRandon on "Modifying data before inserting into user registration table."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modifying-data-before-inserting-into-user-registration-table#post-17510</link>
			<pubDate>Wed, 02 Feb 2011 22:40:27 +0000</pubDate>
			<dc:creator>BandonRandon</dc:creator>
			<guid isPermaLink="false">17510@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;So this works fine on my developement enviroment but as soon as i moved it to production and changed the form ID to the correct ID it stopped working. I'm getting the phone number stored in the (NNN) NNN-NNNN format. &#60;/p&#62;
&#60;p&#62;I don't see anything wrong with this code&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_save_field_value&#38;quot;, &#38;quot;ba_save_phone_value&#38;quot;, 9, 4);
function ba_save_phone_value($value, $lead, $field, $form){

    if($form[&#38;#39;id&#38;#39;] != 4 &#124;&#124; $field[&#38;#39;id&#38;#39;] != 3 ){
        return $value;
        }

        $value = preg_replace(&#38;#39;/\D/&#38;#39;, &#38;#39;&#38;#39;, $value );
        return $value;

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Its weird that it works perfect on one server not on the other. The only difference I can think of is the dev site only has one form.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Modifying data before inserting into user registration table."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modifying-data-before-inserting-into-user-registration-table#post-16416</link>
			<pubDate>Mon, 17 Jan 2011 10:43:01 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">16416@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sent you an email as well, but posting here for the benefit of other users who might have a similar desire.&#60;/p&#62;
&#60;p&#62;The following code snippet uses to the &#60;strong&#62;gform_save_field_value&#60;/strong&#62; to modify the value of the field immediately before it is saved to the database. This will allow you to override any formatting that Gravity Forms automatically applies to value types such as the phone field.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/1469933&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1469933&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>BandonRandon on "Modifying data before inserting into user registration table."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/modifying-data-before-inserting-into-user-registration-table#post-16392</link>
			<pubDate>Sun, 16 Jan 2011 20:24:14 +0000</pubDate>
			<dc:creator>BandonRandon</dc:creator>
			<guid isPermaLink="false">16392@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, &#60;/p&#62;
&#60;p&#62;I am using the User registration add-on and am trying to edit one of my custom meta fields (the phone field. I have this mostly working.&#60;/p&#62;
&#60;p&#62;I'm using this function to get the phone data and strip all non numeric characters. The problem is I'm unsure how to send my modified data back to the meta data before it's inserted into the WP user_meta table.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission_1&#38;quot;, &#38;quot;ba_signup_pre_submission_handler&#38;quot;);
function ba_signup_pre_submission_handler($form_meta){
  	//handling single-input fields such as text and paragraph (textarea)
        // get data from forum
        $phone = $_POST[&#38;quot;input_3&#38;quot;];
       //strip off all non-numbers
        $phone_numbers = preg_replace(&#38;quot;/[^0-9]/&#38;quot;, &#38;quot;&#38;quot;, $phone );
        //send back to add-on (this step isnt&#38;#39; working)
        $_POST[&#38;quot;input_3&#38;quot;] = $phone_numbers;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I know the first two steps are working it's just the sending back that's a problem. Any help would be great. &#60;/p&#62;
&#60;p&#62;Brooke&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://dev.brandondukes.com/wordpress2/signup/&#34; rel=&#34;nofollow&#34;&#62;http://dev.brandondukes.com/wordpress2/signup/&#60;/a&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
