function taxonomy_menu_node_update in Taxonomy menu 7
Same name and namespace in other branches
- 8 taxonomy_menu.module \taxonomy_menu_node_update()
- 7.2 taxonomy_menu.module \taxonomy_menu_node_update()
Implements hook_node_update().
File
- ./
taxonomy_menu.module, line 427 - Adds links to taxonomy terms into a menu.
Code
function taxonomy_menu_node_update($node) {
if (isset($node->original->status) and $node->original->status != $node->status) {
$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 extracting 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('update', $terms, $node);
}
}