1 views_handler_filter_term_node_tid.inc views_handler_filter_term_node_tid::init(&$view, &$options)

Provide some extra help to get the operator/value easier to use.

This likely has to be overridden by filters which are more complex than simple operator/value.

Overrides views_handler_filter_many_to_one::init

File

core/modules/taxonomy/views/views_handler_filter_term_node_tid.inc, line 16
Definition of views_handler_filter_term_node_tid.

Class

views_handler_filter_term_node_tid
Filter by term id.

Code

function init(&$view, &$options) {
  parent::init($view, $options);
  if (!empty($this->definition['vocabulary'])) {
    $this->options['vocabulary'] = $this->definition['vocabulary'];
  }

  // Convert legacy vid option to machine name vocabulary.
  if (isset($this->options['vid']) && !empty($this->options['vid']) && empty($this->options['vocabulary'])) {
    $vocabularies = taxonomy_vocabulary_load_multiple(FALSE);
    $vid = $this->options['vid'];
    if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
      $this->options['vocabulary'] = $vocabularies[$vid]->machine_name;
    }
  }
}