You are here

function hook_widget_info in Content Construction Kit (CCK) 5

Declare information about a widget.

Return value

An array keyed by widget name. Each element of the array is an associative array with these keys and values:

  • "label": The human-readable label for the widget.
  • "field types": An array of field type names that can be edited using this widget.

IMPORTANT! - field and widget names will be truncated to 32 characters in the database and in internal arrays, like content_fields().

5 functions implement hook_widget_info()

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

nodereference_widget_info in ./nodereference.module
Implementation of hook_widget_info().
number_widget_info in ./number.module
Implementation of hook_widget_info().
optionwidgets_widget_info in ./optionwidgets.module
Implementation of hook_widget_info().
text_widget_info in ./text.module
Implementation of hook_widget_info().
userreference_widget_info in ./userreference.module
Implementation of hook_widget_info().
1 invocation of hook_widget_info()
_content_type_info in ./content.module
Collate all information on content types, fields, and related structures.

File

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

Code

function hook_widget_info() {
  return array(
    'text' => array(
      'label' => t('Text Field'),
      'field types' => array(
        'text',
      ),
    ),
  );
}