You are here

function _nodewords_prepare in Nodewords: D6 Meta Tags 5

Prepare the tags so they are ready for output. This includes:

  • setting default values if the tag is empty
  • adding or altering some content (eg add global keywords)
1 call to _nodewords_prepare()
nodewords_get in ./nodewords.module
Get the defined meta tags for $type / $id.

File

./nodewords.module, line 829
Assign META tags to nodes, vocabularies, terms and pages.

Code

function _nodewords_prepare($type, $ids, $tags, $filtered = TRUE) {

  // Prepare the tags
  _nodewords_invoke($tags, 'prepare', $type, $ids);

  // Filter out tags the user has chosen not to see
  if ($filtered) {
    $tags = _nodewords_filter_viewable($tags);
  }

  // EXCEPTION - QUICK HACK - DANGER AHEAD - BRAIN SWITCH-OFF
  if (isset($tags['geourl']) && !empty($tags['geourl'])) {
    $tags['geourl'] = str_replace(array(
      ' ',
      '	',
    ), '', $tags['geourl']);
    $tags['geo.position'] = str_replace(',', ';', $tags['geourl']);
    $tags['ICBM'] = str_replace(';', ',', $tags['geourl']);
    unset($tags['geourl']);
  }

  // Check 'content' of each tag
  $tags = array_map('_nodewords_check_content', $tags);
  return $tags;
}