function profile_field_delete
profile_field_delete($form, &$form_state, $fid)
Menu callback; deletes a field from all user profiles.
File
- modules/profile/profile.admin.inc, line 396
- Administrative page callbacks for the profile module.
Code
function profile_field_delete($form, &$form_state, $fid) { $field = db_query("SELECT title FROM {profile_field} WHERE fid = :fid", array(':fid' => $fid))->fetchObject(); if (!$field) { drupal_not_found(); return; } $form['fid'] = array('#type' => 'value', '#value' => $fid); $form['title'] = array('#type' => 'value', '#value' => $field->title); return confirm_form($form, t('Are you sure you want to delete the field %field?', array('%field' => $field->title)), 'admin/config/people/profile', t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="@edit-field">edit this field</a> and change it to a hidden profile field so that it may only be accessed by administrators.', array('@edit-field' => url('admin/config/people/profile/edit/' . $fid))), t('Delete'), t('Cancel')); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!profile!profile.admin.inc/function/profile_field_delete/7.x