You are here

function hook_element_plugin_alter in Drupal 10

Same name and namespace in other branches
  1. 8 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().
1 invocation of hook_element_plugin_alter()
ElementInfoManager::__construct in core/lib/Drupal/Core/Render/ElementInfoManager.php
Constructs an ElementInfoManager object.

File

core/lib/Drupal/Core/Render/theme.api.php, line 814
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\\mymodule\\Element\\MyLayoutBuilderElement';
}