You are here

function field_collection_field_create_field in Field collection 7

Implements hook_field_create_field().

File

./field_collection.module, line 1857
Module implementing field collection field type.

Code

function field_collection_field_create_field($field) {
  if ($field['type'] === 'field_collection') {
    field_attach_create_bundle('field_collection_item', $field['field_name']);

    // Clear caches.
    entity_info_cache_clear();

    // Do not directly issue menu rebuilds here to avoid potentially multiple
    // rebuilds. Instead, let menu_get_item() issue the rebuild on the next
    // request.
    variable_set('menu_rebuild_needed', TRUE);
  }
}