You have to use the GF feature “Allow field to be populated dynamically”.
You write a GF filter that pulls the email from the url using get_query_var().
add_filter('gform_field_value_email', 'pf_populate_email'));
You will need to tell WordPress to honor the custom query parameter (via a query_vars filter) so that get_query_var() will see it. See
http://codex.wordpress.org/Function_Reference/get_query_var
for an example.
The code will probably be in your theme’s functions.php
So do you put this in Advanced, default value: add_filter(‘gform_field_value_email’, ‘pf_populate_email’));
or does it go in functions.php?
Sorry, my bad.
The value on the form, in this example, is “email” (no quotes)
GF then takes that value, prefixes it with “gform_field_value_” and calls the resulting function that’s defined for that filter. E.g. “gform_field_value_email” has an associated function “pf_populate_email”
Ok.
1. Add “email” to the hidden field default value
2. add “add_filter(‘gform_field_value_email’, ‘pf_populate_email’));” to my functions.php
3. add “<?php get_query_var( $var ) ?>” to my functions.php page.
Do I need to customize any of that code?
Am I missing anything?