You are here

function taxonomy_metatags_type in Nodewords: D6 Meta Tags 6.3

Implements hook_metatags_type().

File

includes/taxonomy.inc, line 11
Integration file for taxonomy.module.

Code

function taxonomy_metatags_type(&$result, $arg) {
  if ($arg[0] == 'taxonomy') {

    // Taxonomy paths: taxonomy/term/$tid , taxonomy/term/$tid1+$tid2.
    if (isset($arg[1]) && isset($arg[2]) && $arg[1] == 'term') {
      $ids = preg_split('![+, ]!', $arg[2]);
      if (count($ids)) {

        // Take the first ID that is numeric.
        foreach ($ids as $id) {
          if (is_numeric($id)) {
            $result['type'] = NODEWORDS_TYPE_TERM;
            $result['id'] = $id;
            return;
          }
        }
      }
    }
  }
}