Skip to main content
2 of 3
it would be cleared if I would have written "fields," instead of "fieds"
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

There isn't a preset list of widget types; the widget types are the ones defined from modules that implement fields. Using the following code, you can get the list of all the widget types implemented by the enabled modules:

$array = module_invoke_all('field_info');

foreach ($array as $id => $info) {
  print $info['default_widget'];
}

The code essentially invokes all the implementations of hook_field_info(), and print what is defined as default widget.
If you have installed Devel, instead of print you can use dsm().

avpaderno
  • 97.9k
  • 15
  • 164
  • 284