Created
February 28, 2014 03:27
-
-
Save mikeselander/9264627 to your computer and use it in GitHub Desktop.
This is an example of the gform_field_value function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Pre-populates a company ID into a Gravity Forms field from a GET variable | |
* | |
* @since 0.1.0 | |
* | |
*/ | |
add_filter('gform_field_value_company_id', 'company_id_population'); | |
function company_id_population(){ | |
// if we have the proper company GET variable - set the return variable | |
if ( $_GET['company_id'] ){ | |
return $_GET['company_id']; | |
} | |
} |
Still doesn't seem to work.
You have to call a predefined "populate_XXX" function and not use another naming.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
be sure to check the 'allow dynamically populate' field for this field in the form itself
and give it the param-name (in this code-case) : company_id
(gform_field_value_company_id) in where company_id is the parameter you fill in