You are here

function view_revisions_entity_operation_alter in Config Entity Revisions 8.2

Implements hook_entity_operation_alter().

File

modules/view_revisions/view_revisions.module, line 64
view_revisions hook functions.

Code

function view_revisions_entity_operation_alter(array &$operations, EntityInterface $entity) {
  if ($entity
    ->access('revisions') && $entity
    ->hasLinkTemplate('revisions')) {
    $operations['revisions'] = [
      'title' => t('Revisions'),
      'weight' => 100,
      'url' => $entity
        ->toUrl('revisions'),
    ];
  }
}