function merci_core_delete_field in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3
Enables and deletes the specified field.
The normal API function for deleting fields, field_delete_field(), will not work on disabled fields. As a workaround, this function first activates the fields of the specified type and then deletes them.
Parameters
$field_name: The name of the field to enable and delete.
1 call to merci_core_delete_field()
- merci_core_delete_fields in merci_core/
merci_core.module - Enables and deletes fields of the specified type.
File
- merci_core/
merci_core.module, line 429
Code
function merci_core_delete_field($field_name) {
// In case the field is inactive, first activate it and clear the field cache.
if (merci_core_activate_field($field_name)) {
field_cache_clear();
}
// Delete the field.
field_delete_field($field_name);
}