Skip to content

Instantly share code, notes, and snippets.

@doekenorg
Created February 7, 2019 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doekenorg/48157d53a1f8b9c1b09ace85448519ed to your computer and use it in GitHub Desktop.
Save doekenorg/48157d53a1f8b9c1b09ace85448519ed to your computer and use it in GitHub Desktop.
Make Gravity Perks Nested Forms work with Entries in Excel
<?php
//functions.php
add_filter('gfexcel_field_value_form', function ($value, $entry, \GF_Field $field) {
$entries = gp_nested_forms()->get_entries($value);
$nested_form = \GFAPI::get_form(rgar($field, 'gpnfForm'));
$entries = array_map(function ($entry) use ($nested_form) {
return \GFCommon::get_submitted_fields($nested_form, $entry, false, false, 'text', false);
}, $entries);
return implode("-----------\n", $entries);
}, 10, 3)
@mirarabali
Copy link

hi
where I have to put this function.php? in plugin>gf-entries-in-excel or elsewhere?
Thank you

@doekenorg
Copy link
Author

Your theme should have a functions.php file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment