function user_form_test_form_user_cancel_form_alter
Same name in other branches
- 8.9.x core/modules/user/tests/modules/user_form_test/user_form_test.module \user_form_test_form_user_cancel_form_alter()
- 10 core/modules/user/tests/modules/user_form_test/user_form_test.module \user_form_test_form_user_cancel_form_alter()
- 11.x core/modules/user/tests/modules/user_form_test/user_form_test.module \user_form_test_form_user_cancel_form_alter()
Implements hook_form_FORM_ID_alter() for user_cancel_form().
File
-
core/
modules/ user/ tests/ modules/ user_form_test/ user_form_test.module, line 11
Code
function user_form_test_form_user_cancel_form_alter(&$form, &$form_state) {
$form['user_cancel_confirm']['#default_value'] = FALSE;
$form['access']['#value'] = \Drupal::currentUser()->hasPermission('cancel other accounts');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.