You are here

function _faq_delete_custom_fields in Frequently Asked Questions 7

Cleanup custom fields on uninstall.

1 call to _faq_delete_custom_fields()
faq_uninstall in ./faq.install
Implements hook_uninstall().

File

./faq.install, line 568
FAQ module install file.

Code

function _faq_delete_custom_fields() {
  foreach (array_keys(_faq_installed_fields()) as $field) {
    field_delete_field($field);
  }
  $instances = field_info_instances('node', 'faq');
  foreach ($instances as $instance_name => $fieldinstance) {
    field_delete_instance($fieldinstance);
  }
}