1. drupal
    1. 8
    2. 7
7 – 8 field_info_field($field_name)

Returns data about an individual field, given a field name.


$field_name The name of the field to retrieve. $field_name can only refer to a non-deleted, active field. Use field_read_fields() to retrieve information on deleted or inactive fields.

Return value

The field array, as returned by field_read_fields(), with an additional element 'bundles', whose value is an array of all the bundles this field belongs to keyed by entity type.

See also


Related topics

▾ 53 functions call field_info_field()

CommentFieldsTest::testCommentDefaultFields in modules/comment/comment.test
Tests that the default 'comment_body' field is correctly added.
EntityFieldQuery::addFieldCondition in modules/entity/
Adds the given condition to the proper condition array.
EntityFieldQuery::fieldOrderBy in modules/entity/
Orders the result set by a given field column.
FieldAttachStorageTestCase::testFieldStorageDetailsAlter in modules/field/tests/field.test
Test storage details alteration.
FieldInfoTestCase::testFieldPrepare in modules/field/tests/field.test
Test that cached field definitions are ready for current runtime context.
FieldSqlStorageTestCase::testFieldSqlStorageForeignKeys in modules/field/modules/field_sql_storage/field_sql_storage.test
Test foreign key support.
FieldSqlStorageTestCase::testFieldStorageDetails in modules/field/modules/field_sql_storage/field_sql_storage.test
Test the storage details.
FieldTranslationsTestCase::testFieldDisplayLanguage in modules/field/tests/field.test
Tests display language logic for translatable fields.
FieldUIManageFieldsTestCase::assertFieldSettings in modules/field_ui/field_ui.test
Assert the field settings.
FieldUIManageFieldsTestCase::testDeleteField in modules/field_ui/field_ui.test
Tests that deletion removes fields and instances as expected.
field_delete_field in modules/field/
Marks a field and its instances and data for deletion.
field_delete_instance in modules/field/
Marks a field instance and its data for deletion.
field_get_display in modules/field/field.module
Returns the display settings to use for an instance in a given view mode.
field_sql_storage_field_storage_delete_instance in modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_delete_instance().
field_test_field_attach_delete_bundle in modules/field/tests/
Implements hook_field_attach_delete_bundle().
field_test_field_storage_delete_instance in modules/field/tests/
Implements hook_field_storage_delete_instance().
field_ui_display_overview_form in modules/field_ui/
Menu callback; presents field display settings for a given view mode.
field_ui_existing_field_options in modules/field_ui/
Return an array of existing field to be added to a bundle.
field_ui_fields_list in modules/field_ui/
Menu callback; lists all defined fields for quick reference.
field_ui_field_delete_form in modules/field_ui/
Menu callback; present a form for removing a field instance from a bundle.
field_ui_field_delete_form_submit in modules/field_ui/
Removes a field instance from a bundle.
field_ui_field_edit_form in modules/field_ui/
Menu callback; presents the field instance edit page.
field_ui_field_edit_form_submit in modules/field_ui/
Form submit handler for field instance settings form.
field_ui_field_overview_form in modules/field_ui/
Menu callback; listing of fields for a bundle.
field_ui_field_overview_form_submit in modules/field_ui/
Submit handler for the field overview form.
field_ui_field_settings_form in modules/field_ui/
Menu callback; presents the field settings edit page.
field_ui_field_settings_form_submit in modules/field_ui/
Save a field's settings after editing.
field_ui_menu_load in modules/field_ui/field_ui.module
Menu loader; Load a field instance based on field and bundle name.
field_ui_widget_type_form in modules/field_ui/
Menu callback; select a widget for the field.
field_view_field in modules/field/field.module
Returns a renderable array for the value of a single field in an entity.
field_view_value in modules/field/field.module
Returns a renderable array for a single field value.
FileFieldDisplayTestCase::testNodeDisplay in modules/file/tests/file.test
Test normal formatter display on node display.
FileFieldRevisionTestCase::testRevisions in modules/file/tests/file.test
Test creating multiple revisions of a node and managing the attached files.
FileFieldValidateTestCase::testFileExtension in modules/file/tests/file.test
Test the file extension, do additional checks if mimedetect is installed.
FileFieldValidateTestCase::testFileMaxSize in modules/file/tests/file.test
Test the max file size validator.
FileFieldValidateTestCase::testRequired in modules/file/tests/file.test
Test required property on file fields.
FileFieldWidgetTestCase::testMultiValuedWidget in modules/file/tests/file.test
Tests upload and remove buttons, with and without Ajax, for multiple multi-valued File field.
FileFieldWidgetTestCase::testPrivateFileSetting in modules/file/tests/file.test
Tests a file field with a "Private files" upload destination setting.
FileFieldWidgetTestCase::testSingleValuedWidget in modules/file/tests/file.test
Tests upload and remove buttons, with and without Ajax, for a single-valued File field.
FileTokenReplaceTestCase::testFileTokenReplacement in modules/file/tests/file.test
Creates a file, then tests the tokens generated from it.
forum_enable in modules/forum/forum.install
Implements hook_enable().
forum_menu_local_tasks_alter in modules/forum/forum.module
Implements hook_menu_local_tasks_alter().
hook_field_storage_delete_instance in modules/field/field.api.php
Act on deletion of a field instance.
ImageFieldDisplayTestCase::testImageFieldDefaultImage in modules/image/image.test
Test use of a default image with an image field.
ListFieldUITestCase::assertAllowedValuesInput in modules/field/modules/list/tests/list.test
Tests a string input for the 'allowed values' form element.
ListFieldUITestCase::testListAllowedValuesBoolean in modules/field/modules/list/tests/list.test
List (boolen) : test 'On/Off' values input.
LocaleMultilingualFieldsFunctionalTest::setUp in modules/locale/locale.test
locale_field_node_form_submit in modules/locale/locale.module
Form submit handler for node_form().
node_add_body_field in modules/node/node.module
Add default body field to a node type.
TaxonomyTermFieldTestCase::testTaxonomyTermFieldChangeMachineName in modules/taxonomy/taxonomy.test
Tests that vocabulary machine name changes are mirrored in field definitions.
taxonomy_autocomplete in modules/taxonomy/
Helper function for autocompletion
_field_invoke in modules/field/
Invoke a field hook.
_field_ui_field_overview_form_validate_add_existing in modules/field_ui/
Helper function for field_ui_field_overview_form_validate.


modules/field/, line 626

function field_info_field($field_name) {
  $info = _field_info_collate_fields();
  if (isset($info['field_ids'][$field_name])) {
    return $info['fields'][$info['field_ids'][$field_name]];