1 field.info.inc field_info_instance($entity_type, $field_name, $bundle_name)

Returns an array of instance data for a specific field and bundle.

Parameters

$entity_type: The entity type for the instance.

$field_name: The field name for the instance.

$bundle_name: The bundle name for the instance.

Return value

An associative array of instance data for the specific field and bundle; NULL if the instance does not exist.

Related topics

File

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

Code

function field_info_instance($entity_type, $field_name, $bundle_name) {
  $info = _field_info_collate_fields();
  if (isset($info['instances'][$entity_type][$bundle_name][$field_name])) {
    return $info['instances'][$entity_type][$bundle_name][$field_name];
  }
}