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.
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:
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.
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.
I’ve added an installable plugin that won’t be affected by theme updates. Click Here To Download The ZIP.