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.

getting to values in form in php code

  1. john_doe
    Member

    Hi all,

    I created some form using GravityForms. Now I`m in the middle of creating my 1st plugin which will be responsible for creating new user, send my form and create user.
    The question is How to get the values from form created by GravityForms.
    Is there sometning like key=>vlaue ???

    Best Regards

    Posted 13 years ago on Tuesday September 28, 2010 | Permalink
  2. Are you wanting to get the form field values after the form is submitted so that you can then run custom code after the form has been submitted to create a user?

    Posted 13 years ago on Tuesday September 28, 2010 | Permalink
  3. Krystian
    Member

    yes

    Posted 13 years ago on Wednesday September 29, 2010 | Permalink
  4. You have to use a hook to implement your code after the form has been submitted.

    There is a gform_post_submission hook that lets you do execute custom code after the form has been submitted.

    The gform_post_submission hook has access to the $form object and the $entry object so you can access both the raw data from the form itself as well as the entry that was created.

    Doing user registration is going to be fairly advanced, how comfortable are you with WordPress development and using hooks?

    Posted 13 years ago on Wednesday September 29, 2010 | Permalink
  5. Krystian
    Member

    This is my first adventure with wordpress.
    Can you give me some sample code of such a thing?
    Now I know how to add new user in other way - not by the values of my registration form.
    I wrote simple so far plugin.

    <php
    require_once(ABSPATH . WPINC . '/registration.php');
    add_action("gform_pre_submission", "pre_submission_handler");
    function pre_submission_handler($form_meta){
    $userdata = array(
      'user_login' => 'login',
      'user_email' => 'email@o2.pl',
      'user_pass' => 'pass',
      'description' => var_export($form_meta, true)
    );
    wp_insert_user($userdata);
        //wp_create_user('username', 'password', $form_meta);
    }
    ?>
    Posted 13 years ago on Wednesday September 29, 2010 | Permalink
  6. Anonymous
    Unregistered

    Were you able to figure this out? I'd love a way to have a user created upon form submission. Carl, I heard that you're planning on supporting user registration in the next release. Is this true?

    Posted 13 years ago on Friday October 29, 2010 | Permalink
  7. Anonymous
    Unregistered

    Nevermind, found this thread...

    http://forum.gravityhelp.com/topic/gravity-forms-wordpress-registration#post-10779

    Posted 13 years ago on Friday October 29, 2010 | Permalink