Insert Office Autopilot & Pilot Press Logged In User Email Into Gravity Forms Hidden Field

So it turns out that everything I’ve been posting lately is really so I can remember what the hell I need to do next time. ┬áThis post is no different.

The Situation

I need to create a gravity form inside a Pilot Press protected members area and pass the email variable by getting it from the logged in user.

How To Do It

First, grab this code:

Then…
Paste it into your Theme’s functions.php file at the bottom. Save it (of course).

Now create your form in GravityForms, set the email field to ‘Allow field to be populated dynamically’ and enter the hook ‘member_email’ for the parameter name. Just in case you don’t know, do not include the quotes around member_email. Update your form. See this picture.

GravityForms Hidden Email Setup

FAQ

How do I know to use ‘member_email’ for the parameter?

Easy. You just drop the first part of the code where it says: ‘gform_field_value_’ and you are left with ‘member_email’ which is your parameter.

UPDATE: 10/06/2013

I’ve added an installable plugin that won’t be affected by theme updates. Click Here To Download The ZIP.

2 Comments

  1. Rob Warner on February 15, 2015 at 6:27 pm

    Hi Darren

    Great plugin – I like it a lot. I would like a version to add other ontraport fields prepopulated in the form. Would you be able to provide an update to the plugin to do this?

    Not looking for a freebie – happy to pay
    Thanks
    Rob

    • darrencrawford on February 17, 2015 at 8:03 am

      Hey Rob – what other fields are you looking to pre-populate?

Leave a Comment