function hook_field_is_empty

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 field.api.php hook_field_is_empty($item, $field)
cle7 field.api.php hook_field_is_empty($item, $field)
elmsmedia7 field.api.php hook_field_is_empty($item, $field)
icor7 field.api.php hook_field_is_empty($item, $field)
meedjum_blog7 field.api.php hook_field_is_empty($item, $field)
mooc7 field.api.php hook_field_is_empty($item, $field)

Define what constitutes an empty item for a field type.

Parameters

$item: An item that may or may not be empty.

$field: The field to which $item belongs.

Return value

TRUE if $field's type considers $item not to contain any data; FALSE otherwise.

Related topics

16 functions implement hook_field_is_empty()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

date_field_is_empty in sites/all/modules/ulmus/date/date.field.inc
Implements hook_field_is_empty().
email_field_is_empty in sites/all/modules/ulmus/email/email.module
Implements hook_content_is_empty().
entityreference_field_is_empty in sites/all/modules/ulmus/entityreference/entityreference.module
Implements hook_field_is_empty().
field_collection_field_is_empty in sites/all/modules/ulmus/field_collection/field_collection.module
Implements hook_field_is_empty().
field_hidden_field_is_empty in sites/all/modules/ulmus/field_hidden/field_hidden.module
Assesses whether a field item is to be considered empty.

... See full list

1 invocation of hook_field_is_empty()
field_collection_item_is_empty in sites/all/modules/ulmus/field_collection/field_collection.module
Determines whether a field collection item entity is empty based on the collection-fields.

File

modules/field/field.api.php, line 683

Code

function hook_field_is_empty($item, $field) {
  if (empty($item['value']) && (string) $item['value'] !== '0') {
    return TRUE;
  }
  return FALSE;
}