You are here

function hook_simplifying_hide_field_alter in Simplifying 8

Alter hide form fields.

Parameters

array $form: The form in which the fields will be hidden.

string $field: The name of the field to be hidden.

1 invocation of hook_simplifying_hide_field_alter()
EntityFields::hideField in src/Services/EntityFields.php
Hide entity form field.

File

./simplifying.api.php, line 31
Document all supported APIs.

Code

function hook_simplifying_hide_field_alter(array &$form, string &$field) {

  // The exception of hiding the default field from the module list.
  if ($field == 'field') {
    $field = '';
  }

  // Hiding your own form field.
  if ($field == 'field2') {
    $form['my_field']['#access'] = FALSE;
  }
}