function hook_field_attach_submit
hook_field_attach_submit($entity_type, $entity, $form, &$form_state)
Act on field_attach_submit().
This hook is invoked after the field module has performed the operation.
Parameters
$entity_type: The type of $entity; for example, 'node' or 'user'.
$entity: The entity for which an edit form is being submitted. The incoming form values have been extracted as field values of the $entity object.
$form: The form structure where field elements are attached to. This might be a full form structure, or a sub-part of a larger form. The $form['#parents'] property can be used to identify the corresponding part of $form_state['values'].
$form_state: An associative array containing the current state of the form.
Related topics
File
- modules/field/field.api.php, line 1372
- Hooks provided by the Field module.
Code
function hook_field_attach_submit($entity_type, $entity, $form, &$form_state) { // Sample case of an 'Empty the field' checkbox added on the form, allowing // a given field to be emptied. $values = drupal_array_get_nested_value($form_state['values'], $form['#parents']); if (!empty($values['empty_field_foo'])) { unset($entity->field_foo); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!field.api.php/function/hook_field_attach_submit/7.x