You are here

function profile2_page_delete_confirm_form_submit in Profile 2 7.2

Same name and namespace in other branches
  1. 7 contrib/profile2_page.inc \profile2_page_delete_confirm_form_submit()

File

contrib/profile2_page.inc, line 148
Adds separate pages for viewing and editing profiles.

Code

function profile2_page_delete_confirm_form_submit($form, &$form_state) {
  $profile = $form_state['profile2'];
  $type = profile2_get_types($profile->type);
  $profile
    ->delete();
  drupal_set_message(t('Deleted %label.', array(
    '%label' => $type
      ->getTranslation('label'),
  )));
  $form_state['redirect'] = 'user/' . $profile->uid;
}