You are here

function nodewords_extra_location_prepare in Nodewords: D6 Meta Tags 6.2

Same name and namespace in other branches
  1. 6 nodewords_extra/nodewords_extra.module \nodewords_extra_location_prepare()

Set the meta tag content.

File

nodewords_extra/includes/nodewords_extra.nodewords.tags.inc, line 244
Nodewords support file.

Code

function nodewords_extra_location_prepare(&$tags, $content, $options) {
  if (!empty($content['latitude']) && !empty($content['longitude'])) {
    $latitude = nodewords_replace_tokens($content['latitude'], $options);
    $longitude = nodewords_replace_tokens($content['longitude'], $options);
    $bool = is_numeric($latitude) && is_numeric($longitude) && $latitude >= -180 && $latitude <= 180 && is_numeric($longitude) && is_numeric($longitude) && $longitude >= -180 && $longitude <= 180;
    if ($bool) {
      $tags['location:geo.position'] = $latitude . ';' . $longitude;
      $tags['location:icbm'] = $latitude . ',' . $longitude;
    }
  }
}