Hi all, I would like ask for how to remove(or hide) some terms from drop box, because I need hide some terms. I thought that I will use mymodule_form_alter(), but when i use dsm($form) in this function there is not list of terms.

I thought that I will use similar code:

    global $user;
    foreach ($form['taxonomy'] as $vid => $vocabulary) {
      if (is_numeric($vid) && private_taxonomy_is_vocabulary_private($vid) && isset($vocabulary['#options'])) {
        foreach ($vocabulary['#options'] as $key => $option) {
          if (is_numeric($key)) {
            foreach ($option->option as $tid => $value) {
              if (private_taxonomy_term_get_user($tid)!=$user->uid) {
                unset($form['taxonomy'][$vid]['#options'][$key]->option[$tid]);
              }
            }
          }
        }
      }
    }

Thanks for help

Comments

marinex’s picture

Issue summary: View changes