You are here

function _cshs_shift_parent in Client-side Hierarchical Select 7

Helper that returns the first tid of an array of parents from a term object.

Parameters

$parent_tids An array of all parents from a term object:

Return value

int|mixed The first parent tid

1 call to _cshs_shift_parent()
_cshs_get_options in ./cshs.module
Collects the options for a field.

File

./cshs.module, line 301
A simple clientside hierarchical select widget for taxonomy terms.

Code

function _cshs_shift_parent($parent_tids) {
  if (count($parent_tids)) {
    $parent_tids = array_values($parent_tids);
    $parent_tid = array_shift($parent_tids);
    return $parent_tid;
  }
  return 0;
}