Skip to content

Instantly share code, notes, and snippets.

@johnennewdeeson
Last active August 29, 2015 14:06
Show Gist options
  • Save johnennewdeeson/5f3f382708f3f0ca8d6e to your computer and use it in GitHub Desktop.
Save johnennewdeeson/5f3f382708f3f0ca8d6e to your computer and use it in GitHub Desktop.
Drupal delete a field instance from an entity bundle in an update hook
/**
* Delete a field instance.
*/
function mymodule_update_7001() {
$instance = field_info_instance('entity_type', 'field_name', 'bundle');
if (!empty($instance)) {
field_delete_instance($instance, FALSE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment