You are here

function _taxonomy_menu_children_has_nodes in Taxonomy menu 7

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

Helper function: See if any of the children have any nodes.

Parameters

$tid: Taxonomy term ID.

$vid: Vocabulary ID.

Return value

boolean

2 calls to _taxonomy_menu_children_has_nodes()
taxonomy_menu_translated_menu_link_alter in ./taxonomy_menu.module
Implements hook_translated_menu_link_alter().
_taxonomy_menu_item in ./taxonomy_menu.module
Helper function: Inserts and updates menu along with taxonomy changes.

File

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

Code

function _taxonomy_menu_children_has_nodes($tid, $vid, $return = FALSE) {
  $children = taxonomy_get_children($tid, $vid);
  foreach ($children as $tid => $term) {
    if (_taxonomy_menu_term_count($tid) > 0) {
      $return = TRUE;
    }
    else {
      $return = _taxonomy_menu_children_has_nodes($tid, $vid, $return);
    }
  }
  return $return;
}