function field_info_formatter_types

Returns information about field formatters from hook_field_formatter_info().

Parameters

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

Return value

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

Related topics

10 calls to field_info_formatter_types()
FieldInfo::prepareInstanceDisplay in drupal/modules/field/field.info.class.inc
Adapts display specifications to the current run-time context.
FieldInfoTestCase::testFieldInfo in drupal/modules/field/tests/field.test
Test that field types and field definitions are correcly cached.
FieldInfoTestCase::testInstancePrepare in drupal/modules/field/tests/field.test
Test that cached instance definitions are ready for current runtime context.
FieldInstanceCrudTestCase::testCreateFieldInstance in drupal/modules/field/tests/field.test
Test the creation of a field instance.
FieldInstanceCrudTestCase::testUpdateFieldInstance in drupal/modules/field/tests/field.test
Test the update of a field instance.

... See full list

File

drupal/modules/field/field.info.inc, line 383
Field Info API, providing information about available fields and field types.

Code

function field_info_formatter_types($formatter_type = NULL) {
  $info = _field_info_collate_types();
  $formatter_types = $info['formatter types'];
  if ($formatter_type) {
    if (isset($formatter_types[$formatter_type])) {
      return $formatter_types[$formatter_type];
    }
  }
  else {
    return $formatter_types;
  }
}