You are here

function features_field_load in Features 7

Same name and namespace in other branches
  1. 7.2 includes/features.field.inc \features_field_load()

Load a field's configuration and instance configuration by an entity_type-bundle-field_name identifier.

2 calls to features_field_load()
field_features_export in includes/features.field.inc
Implements hook_features_export().
field_features_export_render in includes/features.field.inc
Implements hook_features_export_render().

File

includes/features.field.inc, line 209

Code

function features_field_load($identifier) {
  list($entity_type, $bundle, $field_name) = explode('-', $identifier);
  $field_info = field_info_field($field_name);
  $instance_info = field_info_instance($entity_type, $field_name, $bundle);
  if ($field_info && $instance_info) {
    unset($field_info['id']);
    unset($field_info['bundles']);
    unset($instance_info['id']);
    unset($instance_info['field_id']);
    return array(
      'field_config' => $field_info,
      'field_instance' => $instance_info,
    );
  }
  return FALSE;
}