I've written an action hook in my functions.php file...can anyone tell me if I'm heading in the right direction?
function theme_integration($post, $form) {
$post = get_post($entry["post_id"]);
$def_lat = $def_long = 0;
if ( isset( $_POST['location'] ) ) {
list( $def_lat, $def_long ) = explode( ',', $_POST['location'] );
}
$ait_dir_item = array(
'address' => $entry['dummy_ID'],
'gpsLatitude' => $entry['dummy_ID'],
'gpsLongitude' => $entry['dummy_ID'],
'streetViewLatitude' => $entry['dummy_ID'],
'streetViewLongitude' => $entry['dummy_ID'],
'streetViewHeading' => '0',
'streetViewPitch' => '0',
'streetViewZoom' => '0',
'telephone' => $entry['dummy_ID'],
'email' => $entry['dummy_ID'],
'web' => $entry['dummy_ID'],
'hoursMonday' => $entry['dummy_ID'],
'hoursTuesday' => $entry['dummy_ID'],
'hoursWednesday' => $entry['dummy_ID'],
'hoursThursday' => $entry['dummy_ID'],
'hoursFriday' => $entry['dummy_ID'],
'hoursSaturday' => $entry['dummy_ID'],
'hoursSunday' => $entry['dummy_ID'],
'alternativeContent' => $entry['dummy_ID']
);
update_post_meta( $post_id, '_ait-dir-item', $ait_dir_item );
}
add_action("gform_after_submission_1", "theme_integration", 10, 2);
Posted 11 years ago on Wednesday May 8, 2013 |
Permalink