function hook_inline_entity_form_entity_form_alter in Inline Entity Form 8
Same name and namespace in other branches
- 7 inline_entity_form.api.php \hook_inline_entity_form_entity_form_alter()
Perform alterations before an entity form is included in the IEF widget.
Parameters
array $entity_form: Nested array of form elements that comprise the entity form.
\Drupal\Core\Form\FormStateInterface $form_state: The form state of the parent form.
1 invocation of hook_inline_entity_form_entity_form_alter()
- EntityInlineForm::entityForm in src/
Form/ EntityInlineForm.php - Builds the entity form.
File
- ./
inline_entity_form.api.php, line 16 - Hooks provided by the Inline Entity Form module.
Code
function hook_inline_entity_form_entity_form_alter(array &$entity_form, FormStateInterface &$form_state) {
if ($entity_form['#entity_type'] == 'commerce_line_item') {
$entity_form['quantity']['#description'] = t('New quantity description.');
}
}