Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_widget_WIDGET_TYPE_form_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_WIDGET_TYPE_form_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_WIDGET_TYPE_form_alter.twig
new file mode 100644 (file)
index 0000000..366ed69
--- /dev/null
@@ -0,0 +1,9 @@
+/**
+ * Implements hook_field_widget_WIDGET_TYPE_form_alter().
+ */
+function {{ machine_name }}_field_widget_WIDGET_TYPE_form_alter(&$element, &$form_state, $context) {
+  // Code here will only act on widgets of type WIDGET_TYPE.  For example,
+  // hook_field_widget_mymodule_autocomplete_form_alter() will only act on
+  // widgets of type 'mymodule_autocomplete'.
+  $element['#autocomplete_path'] = 'mymodule/autocomplete_path';
+}