hook_element_info_alter

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 hook_element_info_alter(&$type)

Alter the element type information returned from modules.

A module may implement this hook in order to alter the element type defaults defined by a module.

Parameters

$type All element type defaults as collected by hook_element_info().

See also

hook_element_info()

Related topics

Code

modules/system/system.api.php, line 661

<?php
function hook_element_info_alter(&$type) {
  // Decrease the default size of textfields.
  if (isset($type['textfield']['#size'])) {
    $type['textfield']['#size'] = 40;
  }
}
?>