function _hs_taxonomy_hierarchical_select_get_depth in Hierarchical Select 6.3
Same name and namespace in other branches
- 5.3 modules/hs_taxonomy.module \_hs_taxonomy_hierarchical_select_get_depth()
- 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.
3 calls to _hs_taxonomy_hierarchical_select_get_depth()
- hs_content_taxonomy_config_form in modules/
hs_content_taxonomy.admin.inc - Form definition; configuration form for Hierarchical Select as the widget for a content_taxonomy field.
- hs_taxonomy_form_taxonomy_form_vocabulary_alter in modules/
hs_taxonomy.module - hs_taxonomy_views_config_form in modules/
hs_taxonomy_views.module - Form definition; configuration form for Hierarchical Select as the widget for a Taxonomy filter.
File
- modules/
hs_taxonomy.module, line 887 - Implementation of the Hierarchical Select API for the Taxonomy module.
Code
function _hs_taxonomy_hierarchical_select_get_depth($vid) {
$depth = -99999;
$tree = _hs_taxonomy_hierarchical_select_get_tree($vid);
foreach ($tree as $term) {
if ($term->depth > $depth) {
$depth = $term->depth;
}
}
return $depth;
}