function ds_remove_field_confirm_submit in Display Suite 7.2
Same name and namespace in other branches
- 7 ds.fields.inc \ds_remove_field_confirm_submit()
Confirmed field delete or revert submit callback.
2 calls to ds_remove_field_confirm_submit()
- ds_delete_field_confirm_submit in modules/
ds_ui/ includes/ ds.fields.inc - Submit callback: confirmed delete submit.
- ds_revert_field_confirm_submit in modules/
ds_ui/ includes/ ds.fields.inc - Submit callback: confirmed revert submit.
File
- modules/
ds_ui/ includes/ ds.fields.inc, line 536 - Administrative functions for managing custom fields for every entity.
Code
function ds_remove_field_confirm_submit($form, &$form_state, $action = 'deleted') {
$field = $form['#ds_field'];
// Remove field.
db_delete('ds_fields')
->condition('field', $field->field)
->execute();
// Clear cache.
cache_clear_all('ds_fields:', 'cache', TRUE);
// Redirect.
$form_state['redirect'] = 'admin/structure/ds/fields';
drupal_set_message(t('The field %field has been ' . $action, array(
'%field' => $field->label,
)));
}