1 field_example.module field_example_field_is_empty($item, $field)

Implements hook_field_is_empty().

hook_field_is_empty() is where Backdrop asks us if this field is empty. Return TRUE if it does not contain data, FALSE if it does. This lets the form API flag an error when required fields are empty.

Related topics

File

modules/examples/field_example/field_example.module, line 102
Hook implementations for the Field Example module.

Code

function field_example_field_is_empty($item, $field) {
  return empty($item['rgb']);
}