You are here

function _taxonomy_menu_children_has_nodes in Taxonomy menu 8

Same name and namespace in other branches
  1. 6.2 taxonomy_menu.module \_taxonomy_menu_children_has_nodes()
  2. 7.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

File

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

Code

function _taxonomy_menu_children_has_nodes($tid, $vid, $return = FALSE) {
  $children = taxonomy_term_load_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;
}