function hs_content_taxonomy_hierarchical_select_valid_item in Hierarchical Select 6.3
Same name and namespace in other branches
- 5.3 modules/hs_content_taxonomy.module \hs_content_taxonomy_hierarchical_select_valid_item()
Implementation of hook_hierarchical_select_valid_item().
File
- modules/
hs_content_taxonomy.module, line 432 - Implementation of the Hierarchical Select API for the Content Taxonomy module.
Code
function hs_content_taxonomy_hierarchical_select_valid_item($item, $params) {
if (!is_numeric($item) || $item < 1) {
return FALSE;
}
$term = taxonomy_get_term($item);
_content_taxonomy_localize_term($term);
// Bug: tid isn't set to zero for some reason when root term is not set, so we make workaround for this
//$params['tid'] = $params['tid'] ? $params['tid']: 0;
return $term->vid == $params['vid'] && _hs_content_taxonomy_term_within_allowed_depth($term->tid, $term->vid, $params['tid'], $params['depth']);
}