function field_info_field_types

Returns information about field types from hook_field_info().

Parameters

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

Return value

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

Related topics

29 calls to field_info_field_types()
CrudTest::testCreateField in drupal/core/modules/field/lib/Drupal/field/Tests/CrudTest.php
Test the creation of a field.
DisplayOverview::form in drupal/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php
Overrides Drupal\field_ui\OverviewBase::form().
Field::defineOptions in drupal/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
Field::fakeFieldInstance in drupal/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
Provides a fake field instance.
FieldInfoTest::testFieldInfo in drupal/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
Test that field types and field definitions are correcly cached.

... See full list

File

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

Code

function field_info_field_types($field_type = NULL) {
  $info = _field_info_collate_types();
  $field_types = $info['field types'];
  if ($field_type) {
    if (isset($field_types[$field_type])) {
      return $field_types[$field_type];
    }
  }
  else {
    return $field_types;
  }
}