function hook_field_widget_form_alter in Workflow 7.2
Same name and namespace in other branches
- 8 workflow.api.php \hook_field_widget_form_alter()
Alter forms for field widgets provided by other modules.
Parameters
$element: The field widget form element as constructed by hook_field_widget_form().
$form_state: An associative array containing the current state of the form.
$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_WIDGET_TYPE_form_alter()
File
- ./
workflow.api.php, line 189 - Hooks provided by the workflow module.
Code
function hook_field_widget_form_alter(&$element, &$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());
}