Skip to content

Instantly share code, notes, and snippets.

@carlwoodhouse
Last active December 18, 2015 09:49
Show Gist options
  • Save carlwoodhouse/5764220 to your computer and use it in GitHub Desktop.
Save carlwoodhouse/5764220 to your computer and use it in GitHub Desktop.
// in theme functions.php
<?php
add_action('gform_after_submission', 'createPaymentForm', 10, 2);
function createPaymentForm($entry, $form) {
$valuesFound = false;
$fieldId = -1;
$fieldTotalId = -1;
$fieldCounter = 0;
foreach($form["fields"] as $field)
{
$fieldId = ($fieldCounter == 1)? intval($field["id"]) : $fieldId;
$fieldTotalId = ($fieldCounter == 2)? intval($field["id"]) : $fieldTotalId;
$fieldCounter++;
if ($fieldId > -1 && $fieldTotalId > -1) { $valuesFound = true; break; }
}
if ($valuesFound)
{
echo 'markup for your form';
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment