public function Tid::init

Overrides \Drupal\views\Plugin\views\Plugin\views\PluginBase::init().

Overrides PluginBase::init

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument_default/Tid.php, line 30
Definition of Drupal\taxonomy\Plugin\views\argument_default\Tid.

Class

Tid
Taxonomy tid default argument.

Namespace

Drupal\taxonomy\Plugin\views\argument_default

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);

  // @todo Remove the legacy code.
  // Convert legacy vids option to machine name vocabularies.
  if (!empty($this->options['vids'])) {
    $vocabularies = taxonomy_vocabulary_get_names();
    foreach ($this->options['vids'] as $vid) {
      if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
        $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
      }
    }
  }
}