function field_info_widget_types

Returns information about field widgets from hook_field_widget_info().

Parameters

$widget_type: (optional) A widget type name. If omitted, all widget types will be returned.

Return value

Either a single widget type description, as provided by hook_field_widget_info(), or an array of all existing widget types, keyed by widget type name.

Related topics

13 calls to field_info_widget_types()
FieldInfo::prepareInstanceWidget in modules/field/field.info.class.inc
Prepares widget properties for the current run-time context.
FieldInfoTestCase::testFieldInfo in modules/field/tests/field.test
Test that field types and field definitions are correcly cached.
FieldInfoTestCase::testInstancePrepare in modules/field/tests/field.test
Test that cached instance definitions are ready for current runtime context.
FieldInstanceCrudTestCase::testCreateFieldInstance in modules/field/tests/field.test
Test the creation of a field instance.
field_behaviors_widget in modules/field/field.info.inc
Determines the behavior of a widget with respect to an operation.

... See full list

File

modules/field/field.info.inc, line 358

Code

function field_info_widget_types($widget_type = NULL) {
    $info = _field_info_collate_types();
    $widget_types = $info['widget types'];
    if ($widget_type) {
        if (isset($widget_types[$widget_type])) {
            return $widget_types[$widget_type];
        }
    }
    else {
        return $widget_types;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.