You are here

function name_field_is_empty in Name Field 7

Implements hook_field_is_empty().

1 call to name_field_is_empty()
name_element_validate in ./name.module
A custom validator to check the components of a name_element element.

File

./name.module, line 1037
Defines an API for displaying and inputing names.

Code

function name_field_is_empty($item, $field) {
  foreach (_name_translations() as $key => $title) {

    // Title & generational have no meaning by themselves.
    if ($key == 'title' || $key == 'generational') {
      continue;
    }
    if (!empty($item[$key])) {
      return FALSE;
    }
  }
  return TRUE;
}