hook_element_info_alter(array &$info)
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
array $info: An associative array with structure identical to that of the return value of \Drupal\Core\Render\ElementInfoManagerInterface::getInfo().
See also
\Drupal\Core\Render\ElementInfoManager
\Drupal\Core\Render\Element\ElementInterface
Related topics
- Hooks
- Define functions that alter the behavior of Drupal core.
File
- core/lib/Drupal/Core/Render/theme.api.php, line 798
- Hooks and documentation related to the theme and render system.
Code
1 2 3 4 5 6 | function hook_element_info_alter( array & $info ) { // Decrease the default size of textfields. if (isset( $info [ 'textfield' ][ '#size' ])) { $info [ 'textfield' ][ '#size' ] = 40; } } |
Please login to continue.