You are here

function hook_element_info_alter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Render/theme.api.php \hook_element_info_alter()

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

1 invocation of hook_element_info_alter()
ElementInfoManager::buildInfo in core/lib/Drupal/Core/Render/ElementInfoManager.php
Builds up all element information.

File

core/lib/Drupal/Core/Render/theme.api.php, line 761
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;
  }
}