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