Advertisement
Guest User

Gravity Forms Filter

a guest
Dec 26th, 2012
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4.     add_filter("gform_field_value_singlelinetext", "populate_singlelinetext");
  5.     function populate_singlelinetext($value)
  6.     {
  7.         // Use the REQUESTED PHP variables to lookup the appropriate information
  8.         global $wpdb;
  9.         $form_data = $wpdb->get_results("SELECT * FROM wp_rg_lead_detail WHERE form_id = '".$_REQUEST['form_id']."' AND lead_id = '".$_REQUEST['entry_id']."'");
  10.  
  11.         //Loop through array to pick out first name field of 1.3
  12.         foreach($form_data["fields"] as &$field)
  13.             if($form_data["field_number"] == 1.3)
  14.             {            
  15.                 $my_field =$field['value'];
  16.             }
  17.     //    echo '<pre>'; var_dump($form_data); echo '</pre>';
  18.     return $my_field;
  19.     }
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement