You are here

function taxonomy_action_parse_terms in Views Bulk Operations (VBO) 5

Take a multi-dimensional array of vocabularies -> selected terms and return an array of only the terms selected

2 calls to taxonomy_action_parse_terms()
taxonomy_action_submit in ./taxonomy.action.inc
taxonomy_action_validate in ./taxonomy.action.inc

File

./taxonomy.action.inc, line 97

Code

function taxonomy_action_parse_terms($taxonomy) {
  $ret = array();
  while (list(, $vocab) = each($taxonomy)) {
    if (!is_array($vocab)) {
      if (!empty($vocab)) {
        $ret[] = $vocab;
      }
    }
    else {
      while (list(, $tid) = each($vocab)) {
        if (!empty($tid)) {
          $ret[] = $tid;
        }
      }
    }
  }
  return $ret;
}