function AccountForm::alterPreferredLangcodeDescription

Same name in other branches
  1. 8.9.x core/modules/user/src/AccountForm.php \Drupal\user\AccountForm::alterPreferredLangcodeDescription()
  2. 10 core/modules/user/src/AccountForm.php \Drupal\user\AccountForm::alterPreferredLangcodeDescription()
  3. 11.x core/modules/user/src/AccountForm.php \Drupal\user\AccountForm::alterPreferredLangcodeDescription()

Alters the preferred language widget description.

Parameters

array $element: The preferred language form element.

Return value

array The preferred language form element.

File

core/modules/user/src/AccountForm.php, line 328

Class

AccountForm
Form controller for the user account forms.

Namespace

Drupal\user

Code

public function alterPreferredLangcodeDescription(array $element) {
    // Only add to the description if the form element has a description.
    if (isset($element['#description'])) {
        $element['#description'] .= ' ' . $this->t("This is also assumed to be the primary language of this account's profile information.");
    }
    return $element;
}

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