You are here

function _hs_taxonomy_hierarchical_select_get_depth in Hierarchical Select 5.3

Same name and namespace in other branches
  1. 6.3 modules/hs_taxonomy.module \_hs_taxonomy_hierarchical_select_get_depth()
  2. 7.3 modules/hs_taxonomy.module \_hs_taxonomy_hierarchical_select_get_depth()

Get the depth of a vocabulary's tree.

Parameters

$vid: A vocabulary id.

Return value

The depth of the vocabulary's tree.

5 calls to _hs_taxonomy_hierarchical_select_get_depth()
hs_content_taxonomy_config_form in modules/hs_content_taxonomy.module
Form definition; configuration form for Hierarchical Select as the widget for a content_taxonomy field.
hs_content_taxonomy_views_config_form in modules/hs_content_taxonomy_views.module
Form definition; configuration form for Hierarchical Select as the widget for a Taxonomy exposed filter.
hs_content_taxonomy_views_form_alter in modules/hs_content_taxonomy_views.module
Implementation of hook_form_alter().
hs_taxonomy_form_alter in modules/hs_taxonomy.module
Implementation of hook_form_alter().
hs_taxonomy_views_config_form in modules/hs_taxonomy_views.module
Form definition; configuration form for Hierarchical Select as the widget for a Taxonomy exposed filter.

File

modules/hs_taxonomy.module, line 669
Implementation of the Hierarchical Select API for the Taxonomy module.

Code

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