I’m looking for a method to automatically create a new record in the Store Locator plugin (http://www.charlestonsw.com/) when a new user signs up via a Gravity Forms user registration form on the site (http://www.mnla.com). Using the Gravity Forms action hook and function below, I should (I think) be able to produce insertion of a new Store Locator item. This code snippet is included in my functions.php file. What I am getting in Store Locator is a new record, but with none of the data entered.
Do you see anything in here that looks incorrect? Is there another way I might go about doing this?
// Add data to Store Locator
add_action("gform_after_submission_1", "input_fields", 10, 2);
function input_fields($entry, $form){
global $wpdb;
$store = $entry["5"];
$address = $entry["17.1"];
$address2 = $entry["17.2"];
$city = $entry["17.3"];
$state = $entry["17.4"];
$zip = $entry["17.5"];
$email = $entry["16.1"];
$url = $entry["8"];
$phone = $entry["6"];
$SQL = "INSERT INTO wp_store_locator ( sl_id, sl_store, sl_address, sl_address2, sl_city, sl_state, sl_zip, sl_email, sl_url, sl_phone ) VALUES ( '', '$store' , '$address', '$address2', '$city', '$state', '$zip', '$email', '$url', '$phone' )";
$wpdb->query($SQL);
}
Thanks.