Skip to content

Instantly share code, notes, and snippets.

@leepettijohn
Created April 20, 2016 11:03
Show Gist options
  • Select an option

  • Save leepettijohn/600b0d3b47392bf9fbf162a9d6a2bf75 to your computer and use it in GitHub Desktop.

Select an option

Save leepettijohn/600b0d3b47392bf9fbf162a9d6a2bf75 to your computer and use it in GitHub Desktop.
Update a list field in Gravity Forms
// Update a List field in Gravity Forms
//Change the '6' at the end to the correct form id
add_action('gform_post_submission_6','update_list',10,2);
function update_list($entry, $form){
$entry_id = $entry['id'];
//print_r($entry);
$list_values = array(
array(
'Column 1' => 'one',
'Column 2' => 'two',
'Column 3' => 'three',
),
array(
'Column 1' => 'i',
'Column 2' => 'ii',
'Column 3' => 'iii',
),
array(
'Column 1' => '1',
'Column 2' => '2',
'Column 3' => '3',
),
);
$list_value = serialize( $list_values );
//Change the '9' to the correct field id
GFAPI::update_entry_field($entry_id,9,$list_value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment