You are here

function user_revision_entity_operation in User Revision 8

Implements hook_entity_operation() for user entities.

File

./user_revision.module, line 311
User Revision module.

Code

function user_revision_entity_operation(EntityInterface $entity) {
  $operations = array();
  if ($entity
    ->getEntityTypeId() == 'user') {
    $operations['revisions'] = array(
      'title' => t('Revisions'),
      'url' => Url::fromRoute('entity.user.version_history', array(
        'user' => $entity
          ->id(),
      )),
      'weight' => 50,
    );
  }
  return $operations;
}