Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / entity_extra_field_info_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_extra_field_info_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_extra_field_info_alter.twig
new file mode 100644 (file)
index 0000000..06d8e80
--- /dev/null
@@ -0,0 +1,11 @@
+/**
+ * Implements hook_entity_extra_field_info_alter().
+ */
+function {{ machine_name }}_entity_extra_field_info_alter(&$info) {
+  // Force node title to always be at the top of the list by default.
+  foreach (NodeType::loadMultiple() as $bundle) {
+    if (isset($info['node'][$bundle->id()]['form']['title'])) {
+      $info['node'][$bundle->id()]['form']['title']['weight'] = -20;
+    }
+  }
+}