8.5.x theme.api.php hook_element_info_alter(array &$info)
8.0.x theme.api.php hook_element_info_alter(array &$types)
8.1.x theme.api.php hook_element_info_alter(array &$info)
8.2.x theme.api.php hook_element_info_alter(array &$info)
8.3.x theme.api.php hook_element_info_alter(array &$info)
8.4.x theme.api.php hook_element_info_alter(array &$info)
8.6.x theme.api.php hook_element_info_alter(array &$info)
7.x system.api.php 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

array $types: 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

6 functions implement hook_element_info_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

content_translation_element_info_alter in core/modules/content_translation/content_translation.module
Implements hook_element_info_alter().
editor_element_info_alter in core/modules/editor/editor.module
Implements hook_element_info_alter().
language_element_info_alter in core/modules/language/language.module
Implements hook_element_info_alter().
seven_element_info_alter in core/themes/seven/seven.theme
Implements hook_element_info_alter().
test_theme_element_info_alter in core/modules/system/tests/themes/test_theme/test_theme.theme
Implements hook_element_info_alter().

... See full list

File

core/lib/Drupal/Core/Render/theme.api.php, line 798
Hooks and documentation related to the theme and render system.

Code

function hook_element_info_alter(array &$types) {

  // Decrease the default size of textfields.
  if (isset($types['textfield']['#size'])) {
    $types['textfield']['#size'] = 40;
  }
}