Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / entity_operation_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation_alter.twig
new file mode 100644 (file)
index 0000000..a16f031
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Implements hook_entity_operation_alter().
+ */
+function {{ machine_name }}_entity_operation_alter(array &$operations, \Drupal\Core\Entity\EntityInterface $entity) {
+  // Alter the title and weight.
+  $operations['translate']['title'] = t('Translate @entity_type', [
+    '@entity_type' => $entity->getEntityTypeId(),
+  ]);
+  $operations['translate']['weight'] = 99;
+}