Description
Filters the lead value.
Usage
add_filter( 'gform_get_field_value', 'your_function_name', 10, 3 );
Parameters
- $value string
The value of the field. - $entry Entry Object
The current entry. - $field Field Object
The current field.
Example
add_filter( 'gform_get_field_value', 'change_field_value', 10, 3 );
function change_field_value( $value, $entry, $field ){
if ( $field['id'] == 1 ){
$value = 'Testing';
}
return $value;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This filter was added in Gravity Forms version 1.5.
Source Code
This filter is located in:
- GF_Entry_List_Table::column_default() in entry_list.php
- GFFormsModel::get_lead_field_value() in forms_model.php