Небольшой трюк, позволяющий удалить из формы регистрации поле подтверждения пароля.
Drupal 8+
/**
* Implements hook_form_FORM_ID_alter(): user_register_form
*/
function MODULENAME_form_user_register_form_alter(array &$form, FormStateInterface $form_state): void {
$form['account']['pass']['#type'] = 'password';
$form['account']['pass']['#title'] = t('Password');
$form['account']['pass']['#description'] = '';
}
Drupal 7
/**
* Implements hook_form_FORM_ID_alter(): user_register_form
*/
function MODULENAME_form_user_register_form_alter(&$form, &$form_state) {
$form['account']['pass']['#type'] = 'password';
$form['account']['pass']['#title'] = t('Password');
$form['account']['pass']['#description'] = '';
}
Написанное актуально для
Drupal 7, Drupal 8+
Добавить комментарий