Last active
August 29, 2015 14:06
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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