in integration/FacebookWordpressGravityForms.php [97:134]
private static function getAddressData($form, $entry){
if (empty($form['fields'])) {
return array();
}
$address_data = array();
foreach ($form['fields'] as $field) {
if ($field->type == 'address') {
if($field->inputs){
foreach($field->inputs as $input){
if(
array_key_exists('label', $input)
&& $input['label'] != null
){
if($input['label'] == 'City'){
$address_data['city'] = $entry[$input['id']];
}
else if($input['label'] == 'State / Province'){
$address_data['state'] = $entry[$input['id']];
}
else if($input['label'] == 'ZIP / Postal Code'){
$address_data['zip'] = $entry[$input['id']];
}
else if($input['label'] == 'Country'){
if(strlen($entry[$input['id']]) == 2){
$address_data['country'] = $entry[$input['id']];
}
}
}
}
}
break;
}
}
return $address_data;
}