TRUE]; return $options; } /** * Overrides Drupal\views\Plugin\views\row\RowPluginBase::buildOptionsForm(). * * @return array */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['test_enable'] = [ '#type' => 'checkbox', '#title' => $this->t('Controls whether the filter plugin should be active'), '#default_value' => $this->options['test_enable'], ]; } /** * {@inheritdoc} */ public function query() { // Call the parent if this option is enabled. if ($this->options['test_enable']) { parent::query(); } } }