Skip to content

@webaware /gist:4333741
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
filter the eWAY invoice reference for a Gravity Form post
<?php
add_filter('gfeway_invoice_ref', 'my_gfeway_invoice_ref', 10, 2);
/**
* filter the eWAY invoice reference for a Gravity Form post
* @param string $ref the reference before filtering
* @param array $form the Gravity Form object
* @return string
*/
function my_gfeway_invoice_ref($ref, $form) {
// replace 'Membership Number' with the label on your custom field
foreach($form['fields'] as $field) {
if ($field['label'] == 'Membership Number') {
$ref = rgpost('input_' . $field['id']);
break;
}
}
return $ref;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.