Advertisement
chrishajer

Add Entry ID to available fields for Zapier

Mar 8th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. // Add the entry ID as an available field for Zapier
  3. // This will add the entry ID to field 4 in form 16 - edit these values to match your form.
  4. add_filter( 'gform_zapier_field_value', 'add_entry_id_zapier', 10, 4 );
  5. function add_entry_id_zapier( $field_value, $form_id, $field_id, $entry ){
  6.     // apply to field 4 in form 16 only
  7.     if ( $form_id == 16 && $field_id == 4 ){
  8.         return $entry['id'];
  9.     }
  10.     else {
  11.         return $field_value;
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement