hook_element_info_alter

Versions
7
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.

See also

hook_element_info()

Parameters

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

Related topics

Code

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

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

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.