function field_info_field_by_id

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

Parameters

$field_id: The ID of the field to retrieve. $field_id can refer to a deleted field, but not an inactive one.

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.

See also

field_info_field()

Related topics

28 calls to field_info_field_by_id()
FieldInstance::__construct in drupal/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/FieldInstance.php
Constructs a FieldInstance object.
field_attach_delete in drupal/core/modules/field/field.attach.inc
Deletes field data for an existing entity. This deletes all revisions of field data for the entity.
field_attach_delete_revision in drupal/core/modules/field/field.attach.inc
Delete field data for a single revision of an existing entity. The passed entity must have a revision ID attribute.
field_attach_insert in drupal/core/modules/field/field.attach.inc
Save field data for a new entity.
field_attach_load in drupal/core/modules/field/field.attach.inc
Loads fields for the current revisions of a group of entities.

... See full list

File

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

Code

function field_info_field_by_id($field_id) {
  return Field::fieldInfo()
    ->getFieldById($field_id);
}