PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Integration with Wordpress Users

  1. For sites with a large number of users, it'd be great to be able to associate a form submission with the user who submitted it, and even auto-fill profile data where possible.

    Taking that even further, I'd love to use this as a substitute for the stock Wordpress reg form and save collected data in user_meta.

    Posted 10 years ago on Wednesday September 9, 2009 | Permalink
  2. +1 on using GF to either enhance or replace the stock WP reg form.

    Posted 10 years ago on Wednesday September 16, 2009 | Permalink
  3. serenine
    Member

    A very nice feature. +1

    Posted 10 years ago on Wednesday September 16, 2009 | Permalink
  4. David Peralty
    Administrator

    +1 - I'd love to be able to get user avatars (not gravatars), bio info, url, twitter, and more and do it in a nice, easy to look at way right from reg, rather than having them change the info later on within WP and using other plugins to handle such things.

    Posted 10 years ago on Thursday September 17, 2009 | Permalink
  5. vdasilva
    Member

    I would also like to place a vote for this feature.

    Posted 10 years ago on Thursday September 17, 2009 | Permalink
  6. I'll second this motion!

    At the very least attach user ID, especially when they post with these forms.

    Posted 10 years ago on Sunday September 20, 2009 | Permalink
  7. Ditto with the above! :)

    Posted 10 years ago on Sunday September 20, 2009 | Permalink
  8. Here here!

    Posted 10 years ago on Tuesday October 6, 2009 | Permalink
  9. David Peralty
    Administrator

    I'd really like to use Gravity Forms as a replacement for user registration because it is easy to customize the look and feel, and I can now pass query strings from other forms. So they could submit something and then I could redirect them to another page, with some of their details already filled out asking them if they'd like to sign up for a membership as well.

    Posted 10 years ago on Sunday October 18, 2009 | Permalink
  10. net_mage
    Member

    bump.

    Posted 10 years ago on Thursday November 26, 2009 | Permalink
  11. anointed
    Member

    Now this would be an awesome use of gravity forms. Is this possible yet?

    Posted 10 years ago on Wednesday December 9, 2009 | Permalink
  12. User registration is not currently possible. It is something we plan on adding in the future as either part of the core or as an add-on plugin.

    Posted 10 years ago on Wednesday December 9, 2009 | Permalink
  13. +1

    And ability for the users to modify their former submitted data.

    Posted 10 years ago on Thursday April 22, 2010 | Permalink
  14. Just tossing my vote in for sure!

    Posted 10 years ago on Friday May 21, 2010 | Permalink
  15. Me too, would love that functionality

    Posted 10 years ago on Tuesday May 25, 2010 | Permalink
  16. enclave
    Member

    Adding two cents worth, I have been using cms members- which i like to replace registrations and editing profiles but graviy forms is more elegant

    Posted 10 years ago on Friday May 28, 2010 | Permalink
  17. mmtrav
    Member

    +1 for user registration with gravity forms.. and that it could integrate with post submissions as well (ie, user submits post, and gets user name at the same time).

    Posted 9 years ago on Friday June 25, 2010 | Permalink
  18. It's not hard to do actually. Just add a post_submission function that uses the form entry id. All you need to know is the ID of the form you're using and the IDs of the fields you want to work with.

    function create_wp_user($entry, $form){
    if($form["id"] != 1)
            return;
    
    global $wpdb;
    $id = $entry['id'];
    //get the info. for the last form entry
    $migrate = $wpdb->get_results("SELECT field_number, value FROM ".$wpdb->prefix."rg_lead_detail WHERE lead_id = $id ORDER BY field_number",'ARRAY_A');
    
    //get the number of fields so we can loop through and process them
    $count = count($migrate);
    $input = array();
    
    //here we move the results into a single level array of field number => field value
    for($i=0;$i<$count;$i++){
    $key = $migrate[$i]['field_number'];
    $value =$migrate[$i]['value'];
    $input[$key] = $value;
    }
    
    //now we have a single array, $input. Now create a WP user account. In this case, I made WP's user nicename and dsiplay name be a concatenation of their first and last name -- fields 3.3 and 3.6 on my example form. You might have separate fields for those.
        $usernicename = $displayname = $input['3.3']." ".$input['3.6'];
        $email = $input['5'];
        $user_pass = wp_generate_password();
        $curdate = date('Y-m-d-H-i-s');
        $result= $wpdb->query($wpdb->prepare("INSERT INTO wp_users (user_login, user_pass, user_registered, user_email, user_nicename, display_name) VALUES (%s, %s, %s,%s, %s, %s)", array($email, $user_pass, $curdate , $email, $usernicename, $displayname) ) );
    
    //and return the WP user ID of the member you just created
    $user_id = $wpdb->insert_id;
    
    //last thing is to fill in a few values in the member meta table. I'm making these guys be subscribers and since I'm using WordpressMU for this example, I'm also assigning a primary blog it -- which I guess WP3.0 uses too. And I was lazy, I hard coded the blog id. Should use WP function to insert the right one automatically
    
    //now we add in the additonal user_meta values for the primary member //
    $capabilities='a:1:{s:10:"subscriber";b:1;}';
    $user_level ='10';
        $result= $wpdb->insert("wp_usermeta", array('user_id' => $user_id, 'meta_key' => $wpdb->prefix.'capabilities', 'meta_value' => $capabilities) );
        $result= $wpdb->insert("wp_usermeta", array('user_id' => $user_id, 'meta_key' => $wpdb->prefix.'user_level', 'meta_value' => $user_level) );
        $result= $wpdb->insert("wp_usermeta", array('user_id' => $user_id, 'meta_key' => 'primary_blog', 'meta_value' => '2') );
        $result= $wpdb->insert("wp_usermeta", array('user_id' => $user_id, 'meta_key' => 'first_name', 'meta_value' => $input['3.3']) );
        $result= $wpdb->insert("wp_usermeta", array('user_id' => $user_id, 'meta_key' => 'last_name', 'meta_value' => $input['3.6']) );*/
    
    } //end of the function

    You can stick this whole thing in your theme functions file, then make it take effect by adding this right afterwards:

    add_action("gform_post_submission", "create_wp_user", 10, 2);

    If you want to have the password emailed to the user you can do that as well, I didn't bother in this case. The more likely scenario is you're letting them pick a password themselves so you'd simply get rid of the wp_generate_password() part and use the value they submitted.

    Posted 9 years ago on Friday June 25, 2010 | Permalink
  19. mmtrav
    Member

    For those of us for whom long lines are code are a little intimidating..... what we're really after is an easy way to include user registration.. one that would incorporate the fields on the post submission form, and had the drag and drop functionality of the form builder.

    I have a few client sites with this now and dredging through all the theme functions of these sites to drop in this code and test it... seems like a lot of work to me!

    Yes, I'm lazy :)

    Posted 9 years ago on Thursday July 1, 2010 | Permalink
  20. We do plan on adding user registration capabilities to Gravity Forms. However, we have other features that are higher up on the to do list such as import/export, multi-page forms, payment processing integration, etc. BUT it is definitely a feature we will add eventually.

    Posted 9 years ago on Thursday July 1, 2010 | Permalink
  21. "other features that are higher up on the to do list"

    I think the one that should be highest on the list is....not use white text on black background on this forum really hurting my eyes....sorry off topic..

    Posted 9 years ago on Thursday July 1, 2010 | Permalink
  22. mn2
    Member

    can we bring this back to life? I'm really interested in getting a gravity form user registration page, will even pay to have it done.

    I've tried to get Newports code going and have gotten half way there. The problem is the users pass is not sent to him, and it's not saved with md5 encryption in the wp_user db so its useless to wordpress.

    Posted 9 years ago on Tuesday October 5, 2010 | Permalink
  23. We are working on an add-on that will bring user registration capabilities to Gravity Forms. It is tentatively planned to be released alongside Gravity Forms 1.5 later this year and will also integrate with the PayPal add-on we are working on.

    Posted 9 years ago on Tuesday October 5, 2010 | Permalink
  24. mn2
    Member

    This is urgent. I will beta test, or can someone write out a short how to that is complete?

    Posted 9 years ago on Sunday October 10, 2010 | Permalink
  25. Gravity Forms v1.5, the PayPal Add-On and the User Registration Add-On as tentatively planned to be release for beta testing later this month. Keep watching the support site for the announcement.

    Posted 9 years ago on Monday October 11, 2010 | Permalink
  26. mn2
    Member

    I'm looking for a solution sooner than that.

    Newport are you around for any contract work?

    Posted 9 years ago on Monday October 11, 2010 | Permalink
  27. I am really excited about this feature. However, I too would like to be able to use Newport's method in the meantime. Newport, can I contact you for further explanation? I have limited PHP knowledge and need some guidance. Mn2, have you been able to implement this is your blog?

    Posted 9 years ago on Monday October 11, 2010 | Permalink
  28. webakimbo
    Member

    +1 on GF integration with user management. What's the status of v1.5?

    Posted 9 years ago on Wednesday October 27, 2010 | Permalink
  29. Really really REALLY looking forward to this! In fact it miiight arrive just in time for my current site go-live :)

    Posted 9 years ago on Wednesday October 27, 2010 | Permalink
  30. (checks back... hopes... suspends hope.. sends client another email saying "They WILL release it soon, honest! so sorry, please don't fire me for lying to you, it's not the end of November yet")

    Posted 9 years ago on Thursday November 18, 2010 | Permalink
  31. The User Registration Add-On is nearing beta release status. It's still in development and will be released as a Beta 1 hopefully sometime next week.

    Posted 9 years ago on Thursday November 18, 2010 | Permalink
  32. Carl,

    That is great news! I have been waiting for a User Registration Add-On for a longtime :)

    Posted 9 years ago on Thursday November 18, 2010 | Permalink
  33. mates2
    Member

    Yes! It would make my Thanksgiving day even better!

    Posted 9 years ago on Friday November 19, 2010 | Permalink