You are here

function _taxonomy_hierarchical_select_get_depth in Hierarchical Select 5.2

Get the depth of a vocabulary's tree.

Parameters

$vid: A vocabulary id.

Return value

The depth of the vocabulary's tree.

2 calls to _taxonomy_hierarchical_select_get_depth()
taxonomy_hierarchical_select_form_alter in modules/taxonomy.inc
Implementation of hook_hierarchical_select_form_alter().
taxonomy_hierarchical_select_update_form_item in modules/taxonomy.inc
Sets certain Hierarchical Select settings, based on the vid. The user can configure this on the vocabulary administration page, this function applies those settings.

File

modules/taxonomy.inc, line 402

Code

function _taxonomy_hierarchical_select_get_depth($vid) {
  $tree = taxonomy_get_tree($vid);
  foreach ($tree as $term) {
    if ($term->depth > $depth) {
      $depth = $term->depth;
    }
  }
  return $depth;
}