Delete field instance from field collection

Public
</> CopyGet raw version
php
  1. // Delete field instance from field collection.
  2. $entity_type = 'field_collection_item';
  3. $bundle_name = 'field_people_person'; // Field collection entity name (for example added to node).
  4. $field_name = 'field_people_born'; // Field added to field_collection entity.
  5. if ($instance = field_info_instance($entity_type, $field_name, $bundle_name)) {
  6. field_delete_instance($instance);
  7. }