function geocoder_field_form_alter in Geocoder 8.2
Same name and namespace in other branches
- 8.3 modules/geocoder_field/geocoder_field.module \geocoder_field_form_alter()
Implements hook_form_alter().
Eventually Disable or Hide Geocode Fields.
File
- modules/
geocoder_field/ geocoder_field.module, line 22 - Geocoder Field module.
Code
function geocoder_field_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
if ($form_state
->getFormObject() instanceof ContentEntityFormInterface) {
/* @var \Drupal\Core\Entity\EntityForm $entity_form */
$entity_form = $form_state
->getFormObject();
/* @var \Drupal\Core\Entity\ContentEntityInterface $entity */
$entity = $entity_form
->getEntity();
_geocoder_field_alter_form_fields($entity, $form);
}
}