function hook_simplify_hide_field_alter in Simplify 8
Same name and namespace in other branches
- 7.3 simplify.api.php \hook_simplify_hide_field_alter()
Alter the way fields are hidden.
Parameters
array $form: The form array in which the field to be hidden resides. Hiding a field is generally done by setting its '#access' form value to FALSE.
array $field: The machine name of the field to be hidden as defined in simplify_get_fields() or hook_simplify_get_fields_alter().
1 invocation of hook_simplify_hide_field_alter()
- simplify_hide_field in ./
simplify.module - Hide a given field in a form.
File
- ./
simplify.api.php, line 37 - Hooks provided by the Simplify module.
Code
function hook_simplify_hide_field_alter(array &$form, array $field) {
// Hide our module's custom 'foo' node field.
if ($field == 'foo') {
$form['foo']['#attributes']['class'][] = 'visually-hidden';
}
}