You are here

function hs_taxonomy_hierarchical_select_valid_item in Hierarchical Select 5.3

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

Implementation of hook_hierarchical_select_valid_item().

1 call to hs_taxonomy_hierarchical_select_valid_item()
hs_taxonomy_views_hierarchical_select_valid_item in modules/hs_taxonomy_views.module
Implementation of hook_hierarchical_select_valid_item().

File

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

Code

function hs_taxonomy_hierarchical_select_valid_item($item, $params) {
  if ($params['root_term'] && $item == 0) {
    return TRUE;
  }
  else {
    if (!is_numeric($item) || $item < 1 || $item == $params['exclude_tid']) {
      return FALSE;
    }
  }
  $term = taxonomy_get_term($item);
  return $term->vid == $params['vid'];
}