Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Render/theme.api.php \hook_element_plugin_alter()
  2. 9 core/lib/Drupal/Core/Render/theme.api.php \hook_element_plugin_alter()

Alter Element plugin definitions.

Whenever possible, hook_element_info_alter() should be used to alter the default properties of an element type. Use this hook only when the plugin definition itself needs to be altered.

Parameters

array $definitions: An array of Element plugin definitions.

See also

\Drupal\Core\Render\ElementInfoManager

\Drupal\Core\Render\Element\ElementInterface

Related topics

1 function implements hook_element_plugin_alter()

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

element_info_test_element_plugin_alter in core/modules/system/tests/modules/element_info_test/element_info_test.module
Implements hook_element_plugin_alter().

File

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

Code

function hook_element_plugin_alter(array &$definitions) {

  // Use a custom class for the LayoutBuilder element.
  $definitions['layout_builder']['class'] = '\\Drupal\\my_module\\Element\\MyLayoutBuilderElement';
}