field_info_field

7 field.info.inc field_info_field($field_name)
8 field.info.inc field_info_field($field_name)

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

Parameters

$field_name: The name of the field to retrieve. $field_name can only refer to a non-deleted, active field. For deleted fields, use field_info_field_by_id(). To retrieve information about inactive fields, use field_read_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

field_info_field_by_id()

Related topics

60 calls to field_info_field()

File

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

Code

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]];
  }
}
Login or register to post comments