You are here

function taxonomy_menu_node_insert in Taxonomy menu 7

Same name and namespace in other branches
  1. 8 taxonomy_menu.module \taxonomy_menu_node_insert()
  2. 7.2 taxonomy_menu.module \taxonomy_menu_node_insert()

Implements hook_node_insert().

File

./taxonomy_menu.module, line 412
Adds links to taxonomy terms into a menu.

Code

function taxonomy_menu_node_insert($node) {
  $terms_old =& drupal_static('taxonomy_menu_terms_old');

  // We use this direct table pull to avoid the cache and because
  // free tags are not formatted in a matter where extrating the
  // tid's is easy.
  $terms_new = _taxonomy_menu_get_node_terms($node);

  // Merge current terms and previous terms to update both menu items.
  $terms = array_unique(array_merge((array) $terms_new, (array) $terms_old));
  _taxonomy_menu_nodeapi_helper('insert', $terms, $node);
}