hook_widget_info

Versions
5
hook_widget_info()

Declare information about a widget.

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

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.

Code

contributions/cck/field.php, line 316

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

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.