You are here

function _taxonomy_menu_children_has_nodes in Taxonomy menu 7.2

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 taxonomy_menu.module \_taxonomy_menu_children_has_nodes()

Helper function to see if any of the children have any nodes.

Parameters

$tid:

$vid:

Return value

boolean

1 call to _taxonomy_menu_children_has_nodes()
taxonomy_menu_translated_menu_link_alter in ./taxonomy_menu.module
Implements hook_translated_menu_link_alter().

File

./taxonomy_menu.module, line 507
Generates menu links for all selected taxonomy terms.

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;
}