To change the ‘default’ value for a Gravity form field – for example the Gravity Forms Name Filed that currently has not default values then simply add the following code to your functions.php file:-
<?php // add firstname default add_filter('gform_field_value_callback_first', 'populate_callback_first'); function populate_callback_first($value){ return 'Firstname'; } ?>
In my example I am changing the First Name field value for the assigned ‘First’ – a dynamic field that I have called ‘callback_firstname’. To allow dynamic fields in Gravity forms you must also ensure that you go to the Advanced tab on the Gravity form and click ‘Allow field to be populated dynamically’. Make sure you then set a value to callback there. Example below:-