function suggestion_form_alter in Autocomplete Search Suggestions 8
Same name and namespace in other branches
- 8.2 suggestion.module \suggestion_form_alter()
- 7 suggestion.module \suggestion_form_alter()
- 3.0.x suggestion.module \suggestion_form_alter()
Implements hook_form_alter().
File
- ./
suggestion.module, line 26 - Contains suggestion.module.
Code
function suggestion_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$autocomplete = SuggestionHelper::getConfig('autocomplete');
$field_name = !empty($autocomplete[$form_id]) ? $autocomplete[$form_id] : '';
if (!$field_name) {
return;
}
return SuggestionHelper::alterElement($form, $field_name);
}