You are here

function socialbase_preprocess_textarea in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 themes/socialbase/includes/input.inc \socialbase_preprocess_textarea()
  2. 8 themes/socialbase/includes/input.inc \socialbase_preprocess_textarea()
  3. 8.2 themes/socialbase/includes/input.inc \socialbase_preprocess_textarea()
  4. 8.3 themes/socialbase/includes/input.inc \socialbase_preprocess_textarea()
  5. 8.4 themes/socialbase/includes/input.inc \socialbase_preprocess_textarea()
  6. 8.5 themes/socialbase/includes/input.inc \socialbase_preprocess_textarea()
  7. 8.6 themes/socialbase/includes/input.inc \socialbase_preprocess_textarea()
  8. 8.8 themes/socialbase/includes/input.inc \socialbase_preprocess_textarea()

Implements hook_preprocess_textarea().

File

themes/socialbase/includes/input.inc, line 108
The input inc file for the Social base theme.

Code

function socialbase_preprocess_textarea(&$variables) {
  if (isset($variables['element']['#array_parents'])) {
    $context = $variables['element']['#array_parents'];

    // Identify text areas that need to get autogrow behaviour.
    $autogrow_areas = [
      'field_post',
      'field_comment_body',
      'message',
    ];
    $c = array_intersect($context, $autogrow_areas);
    if (count($c) > 0) {
      $variables['autogrow'] = 'true';
    }
  }
}