function tvi_form_taxonomy_term_form_alter in Taxonomy Views Integrator 8
Implements hook_form_BASE_FORM_ID_alter().
File
- ./
tvi.module, line 190 - Allow views to be used instead of default taxonomy term page behavior.
Code
function tvi_form_taxonomy_term_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
$entity = $form_state
->getBuildInfo()['callback_object']
->getEntity();
if ($entity
->id() !== NULL && Drupal::currentUser()
->hasPermission('define view for terms in ' . $entity
->bundle())) {
_tvi_settings_form($form, $form_state, $entity);
}
}