function workflow_devel_field_widget_form_alter in Workflow 8
Alter forms for field widgets provided by other modules.
Parameters
array $element: The field widget form element as constructed by hook_field_widget_form().
FormStateInterface $form_state: An associative array containing the current state of the form.
array $context: An associative array containing the following key-value pairs, matching the arguments received by hook_field_widget_form():
- form: The form structure to which widgets are being attached. This may be a full form structure, or a sub-element of a larger form.
- field: The field structure.
- instance: The field instance structure.
- langcode: The language associated with $items.
- items: Array of default values for this field.
- delta: The order of this item in the array of subelements (0, 1, 2, etc).
See also
hook_field_widget_form()
hook_field_widget_WIDGET_TYPE_form_alter()
File
- modules/
workflow_devel/ workflow_devel.module, line 82 - Development tools for Workflow.
Code
function workflow_devel_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) {
// A hook for changing any widget. Better not use it: it is called on EVERY
// Widget. (Even though the message is only shown once.)
// D7: This hook is introduced in Drupal 7.8.
// workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', '');
// dpm($context['widget']->getPluginId());
hook_field_widget_form_alter($element, $form_state, $context);
}