You are here

function field_example_field_is_empty in Examples for Developers 7

Implements hook_field_is_empty().

hook_field_is_empty() is where Drupal 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

field_example/field_example.module, line 100
An example field using the Field Types API.

Code

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