Last active
October 23, 2018 18:30
-
-
Save init90/0b84d0425233dce2152aa4045a023f44 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$entity_type = 'entity_type_name'; | |
$field_name = 'field_name'; | |
$bundle = 'bundle_name'; | |
// Delete field instance. | |
if ($instance = field_info_instance($entity_type, $field_name, $bundle)) { | |
field_delete_instance($instance, TRUE); | |
field_purge_batch(1); | |
} | |
// Delete field. | |
field_delete_field($field_name); | |
field_purge_batch(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment