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/simple_field.php, line 247
SIMPLE EXAMPLE. This is similar to to example_field but creates only a single widget formatted in the traditional manner, not using hook_elements. This example also omits all optional parts of the field module to create a simpler example for…

Code

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