Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike van Hoenselaar MikevHoenselaar

View GitHub Profile
@MikevHoenselaar
MikevHoenselaar / persistent_multipage_forms-reloaded.php
Last active Jan 20, 2017
Render persistence data before form output changed to work with populated fields.
View persistent_multipage_forms-reloaded.php
```php
// Render persistence data before form output
add_filter("gform_pre_render", "ri_pre_populate_the_form");
function ri_pre_populate_the_form($form) {
if (gfdp_is_persistent($form)) {
$current_page = GFFormDisplay::get_current_page($form["id"]);
if ($current_page == 1) {
$option_key = ri_getFormOptionKeyForGF($form);
if (get_option($option_key)) {
$persistent_info = json_decode(get_option($option_key));
You can’t perform that action at this time.