function user_cancel_url

Same name and namespace in other branches
  1. 10 core/modules/user/user.module \user_cancel_url()
  2. 7.x modules/user/user.module \user_cancel_url()
  3. 9 core/modules/user/user.module \user_cancel_url()
  4. 8.9.x core/modules/user/user.module \user_cancel_url()

Generates a URL to confirm an account cancellation request.

Parameters

\Drupal\user\UserInterface $account: The user account object.

array $options: (optional) A keyed array of settings. Supported options are:

  • langcode: A language code to be used when generating locale-sensitive URLs. If langcode is NULL the users preferred language is used.

Return value

string A unique URL that may be used to confirm the cancellation of the user account.

Deprecated

in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal\user\OneTimeAuthentication::generateCancelConfirmUrl() instead.

See also

\Drupal\user\OneTimeAuthentication::tokens()

\Drupal\user\Controller\UserController::confirmCancel()

https://www.drupal.org/node/3581062

File

core/modules/user/user.module, line 223

Code

function user_cancel_url(UserInterface $account, $options = []) {
  @trigger_error(__METHOD__ . ' is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \\Drupal\\user\\OneTimeAuthentication::generateCancelConfirmUrl() instead. See https://www.drupal.org/node/3581062', E_USER_DEPRECATED);
  return \Drupal::service(OneTimeAuthentication::class)->generateCancelConfirmUrl($account, $options)
    ->toString();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.