You are here

function xmlsitemap_taxonomy_taxonomy in XML sitemap 6.2

Same name and namespace in other branches
  1. 6 xmlsitemap_taxonomy/xmlsitemap_taxonomy.module \xmlsitemap_taxonomy_taxonomy()

Implements hook_taxonomy().

File

xmlsitemap_taxonomy/xmlsitemap_taxonomy.module, line 107

Code

function xmlsitemap_taxonomy_taxonomy($op, $type, $array = NULL) {
  if ($type == 'vocabulary') {
    $vid = $array['vid'];
    if ($op == 'insert' || $op == 'update') {
      if (isset($array['xmlsitemap'])) {
        xmlsitemap_link_bundle_settings_save('taxonomy_term', $vid, $array['xmlsitemap']);
      }
    }
    elseif ($op == 'delete') {
      xmlsitemap_link_bundle_delete('taxonomy_term', $vid);
    }
  }
  if ($type == 'term') {
    $tid = $array['tid'];
    if ($op == 'insert' || $op == 'update') {
      $term = (object) $array;
      $link = xmlsitemap_taxonomy_create_link($term);
      xmlsitemap_link_save($link);
    }
    elseif ($op == 'delete') {
      xmlsitemap_link_delete('taxonomy_term', $tid);
    }
  }
}