Search code examples
phpwordpressgravity-forms-plugin

Gravity Forms: Dynamically populate field label or placeholder


I want to populate an input field with data from the current user. At the moment I populate the fields value parameter but I want to keep the input empty. Therefore it would be great if I could populate the label or the placeholder parameter of the input field.

I couldn't find anything in the docs.

Here's my current code:

add_filter('gform_field_value_username', create_function("", '$value = populate_usermeta(\'nickname\'); return $value;' ));

Solution

  • I believe this should work out-of-the-box with Gravity Forms:

    Screenshot of field settings with the user merge tag in the placeholder setting