You are here

function faq_taxonomy_term_insert in Frequently Asked Questions 7.2

Same name and namespace in other branches
  1. 7 faq.module \faq_taxonomy_term_insert()

Implements hook_taxonomy_term_insert().

File

./faq.module, line 1398
The FAQ module allows users to create a FAQ page, with questions and answers displayed in different styles, according to the settings.

Code

function faq_taxonomy_term_insert($term) {
  if (module_exists('pathauto')) {
    module_load_include('inc', 'pathauto');
    $vocabularies = taxonomy_get_vocabularies('faq');
    $vocab_omit = variable_get('faq_omit_vocabulary', array());
    foreach ($vocabularies as $vid => $vobj) {
      if (isset($vocab_omit[$vid]) && $vocab_omit[$vid] != 0 || $term->vid != $vid) {
        continue;
      }
      $alias = pathauto_create_alias('faq', 'insert', 'faq-page/' . $term->tid, array(
        'term' => $term,
      ));
    }
  }
}