You are here

function workbench_moderation_local_tasks_alter in Workbench Moderation 8

Same name and namespace in other branches
  1. 8.2 workbench_moderation.module \workbench_moderation_local_tasks_alter()

Implements hook_local_tasks_alter().

File

./workbench_moderation.module, line 119
Contains workbench_moderation.module.

Code

function workbench_moderation_local_tasks_alter(&$local_tasks) {
  $content_entity_type_ids = array_keys(array_filter(\Drupal::entityTypeManager()
    ->getDefinitions(), function (EntityTypeInterface $entity_type) {
    return $entity_type
      ->isRevisionable();
  }));
  foreach ($content_entity_type_ids as $content_entity_type_id) {
    if (isset($local_tasks["entity.{$content_entity_type_id}.edit_form"])) {
      $local_tasks["entity.{$content_entity_type_id}.edit_form"]['class'] = EditTab::class;
      $local_tasks["entity.{$content_entity_type_id}.edit_form"]['entity_type_id'] = $content_entity_type_id;
    }
  }
}