function field_info_field
7.x 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. NULL if the field was not found.
See also
Related topics
59 calls to field_info_field()
- CommentFieldsTest::testCommentDefaultFields in drupal-7.x/
modules/ comment/ comment.test - Tests that the default 'comment_body' field is correctly added.
- comment_submit in drupal-7.x/
modules/ comment/ comment.module - Prepare a comment for submission.
- EntityFieldQuery::addFieldCondition in drupal-7.x/
includes/ entity.inc - Adds the given condition to the proper condition array.
- EntityFieldQuery::fieldOrderBy in drupal-7.x/
includes/ entity.inc - Orders the result set by a given field column.
- FieldAttachStorageTestCase::testFieldStorageDetailsAlter in drupal-7.x/
modules/ field/ tests/ field.test - Test storage details alteration.
File
- drupal-7.x/
modules/ field/ field.info.inc, line 518 - Field Info API, providing information about available fields and field types.
Code
function field_info_field($field_name) {
$cache = _field_info_field_cache();
return $cache->getField($field_name);
}