You are here

function faq_taxonomy_term_insert in Frequently Asked Questions 7

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

Implements hook_taxonomy_term_insert().

File

./faq.module, line 1575
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_path() . '/' . $term->tid, array(
        'term' => $term,
      ));
    }
  }
}