You are here

function text_content_is_empty in Content Construction Kit (CCK) 6

Same name in this branch
  1. 6 examples/simple_field.php \text_content_is_empty()
  2. 6 examples/example_field.php \text_content_is_empty()
  3. 6 modules/text/text.module \text_content_is_empty()
Same name and namespace in other branches
  1. 6.3 modules/text/text.module \text_content_is_empty()
  2. 6.2 modules/text/text.module \text_content_is_empty()

Implementation of hook_content_is_empty().

NEW REQUIRED HOOK!

This function tells the content module whether or not to consider the $item to be empty. This is used by the content module to remove empty, non-required values before saving them.

File

examples/example_field.php, line 303
These hooks are defined by field modules, modules that define a new kind of field for insertion in a content type.

Code

function text_content_is_empty($item, $field) {
  if (empty($item['value'])) {
    return TRUE;
  }
  return FALSE;
}