1 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 refer to a deleted or non-deleted field, but not inactive fields. 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. NULL if the field was not found.
Related topics
File
- core/
modules/ field/ field.info.inc, line 724 - 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['fields'][$field_name])) {
return $info['fields'][$field_name];
}
}