SHARE
TWEET

Gravity Forms Filter

a guest Dec 26th, 2012 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top