You are here

function bundle_inherit_field_create_instance in Bundle Inherit 7

Implements hook_field_create_instance().

File

./bundle_inherit.module, line 62
Bundle Inherit module.

Code

function bundle_inherit_field_create_instance($instance) {
  $children = bundle_inherit_bundle_get_children($instance['entity_type'], $instance['bundle']);
  foreach ($children as $bundle) {
    $new_instance = $instance;
    unset($new_instance['id']);
    $new_instance['bundle'] = $bundle['type'];
    $new_instance['locked'] = TRUE;
    field_create_instance($new_instance);
  }
}