diff --git a/core/includes/form.inc b/core/includes/form.inc index 87f8edf..656badc 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -2575,34 +2575,33 @@ function theme_form($variables) { } /** - * Returns HTML for a textarea form element. + * Prepares variables for textarea templates. * - * @param $variables + * Default template: textarea.html.twig. + * + * @param array $variables * An associative array containing: * - element: An associative array containing the properties of the element. * Properties used: #title, #value, #description, #rows, #cols, * #placeholder, #required, #attributes, #resizable * - * @ingroup themeable */ -function theme_textarea($variables) { - $element = $variables['element']; - element_set_attributes($element, array('id', 'name', 'rows', 'cols', 'placeholder')); - _form_set_attributes($element, array('form-textarea')); +function template_preprocess_textarea(&$variables) { + $element = $variables['element']; + element_set_attributes($element, array('id', 'name', 'rows', 'cols', 'placeholder')); + _form_set_attributes($element,array('form-textarea')); + $variables['wrapper_attributes'] = new Attribute(array( + 'class' => array('form-textarea-wrapper'), + )); - $wrapper_attributes = array( - 'class' => array('form-textarea-wrapper'), - ); + // Add resizable behavior. + if (!empty($element['#resizable'])) { + $element['#attributes']['class'][] = 'resize-' . $element['#resizable']; + } - // Add resizable behavior. - if (!empty($element['#resizable'])) { - $element['#attributes']['class'][] = 'resize-' . $element['#resizable']; - } + $variables['attributes'] = new Attribute($element['#attributes']); - $output = '