Skip to content

Instantly share code, notes, and snippets.

@mikeselander
Created February 28, 2014 03:27
Show Gist options
  • Save mikeselander/9264627 to your computer and use it in GitHub Desktop.
Save mikeselander/9264627 to your computer and use it in GitHub Desktop.
This is an example of the gform_field_value function
/**
* 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'];
}
}
@deefuz
Copy link

deefuz commented May 21, 2023

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