Results
06.03.2025
transmuter 1.0.0-alpha2 ::
transmuter.module
/**
* Implements hook_theme_registry_alter().
*/
function transmuter_theme_registry_alter(array &$theme_registry): void {
/** @var \Drupal\transmuter\ThemeRegistryBuilder $themeRegistryBuilder */
$themeRegistryBuilder = \Drupal::service('transmuter.theme_registry');
// Find the active transmuter plugins to apply to the theme registry hooks.
// This gets called and cached for each theme, and will only apply transmuter
// plugins for all modules and those defined by the current ACTIVE theme.
$themeRegistryBuilder->alterRegistry($theme_registry); 06.09.2019
twig_attributes 8.x-1.x-dev ::
twig_attributes.module
/**
* Implements hook_theme_registry_alter().
*/
function twig_attributes_theme_registry_alter(&$theme_registry) {
// Add variables to the "image_formatter" template.
if (isset($theme_registry['image_formatter'])) {
$theme_registry['image_formatter']['variables']['image_attributes'] = NULL;
$theme_registry['image_formatter']['variables']['link_attributes'] = NULL;
} 02.07.2020
ui_patterns_layout_builder 8.x-1.x-dev ::
ui_patterns_layout_builder.module
/**
* Implements hook_theme_registry_alter().
*
* Add region_attributes to the pattern theme.
*/
function ui_patterns_layout_builder_theme_registry_alter(&$theme_registry) {
foreach (UiPatterns::getManager()->getPatterns() as $pattern) {
$definition = $pattern->getPluginDefinition();
if (isset($theme_registry['pattern_' . $definition->id()])) {
$theme_registry['pattern_' . $definition->id()]['variables']['region_attributes'] = [];
}
} 25.08.2020
uikit_components 8.x-3.1 ::
uikit_views/uikit_views.module
/**
* Implements hook_theme_registry_alter().
*/
function uikit_views_theme_registry_alter(&$theme_registry) {
$module_path = \Drupal::service('extension.list.module')->getPath('uikit_views');
// Alter the path so we can put templates into separate directories.
$theme_registry['uikit_view_accordion']['path'] = $module_path . '/templates/views';
$theme_registry['uikit_view_grid']['path'] = $module_path . '/templates/views';
$theme_registry['uikit_view_list']['path'] = $module_path . '/templates/views'; 09.10.2020
upgrade_status 8.x-2.11 ::
src/ThemeFunctionDeprecationAnalyzer.php
public function analyze(Extension $extension): array {
$deprecation_messages = [];
// Analyze hook_theme and hook_theme_registry_alter functions.
$deprecation_messages = array_merge($deprecation_messages, $this->analyzeFunction($extension->getName() . '_' . 'theme', $extension));
$deprecation_messages = array_merge($deprecation_messages, $this->analyzeFunction($extension->getName() . '_' . 'theme_registry_alter', $extension));
// If a theme is being analyzed, theme function overrides need to be
// analyzed.
if ($extension->getType() === 'theme') {
// the array square bracket syntax.
// @code
// function hook_theme_registry_alter(&$theme_registry) {
// $theme_registry['theme_hook']['function'] = 'another_theme_function';
// }
// @endcode
$theme_function_dim_nodes = $finder->find([$function_node], function(Node $node) {
return $node instanceof Assign && $node->var instanceof ArrayDimFetch && $node->var->dim instanceof String_ && $node->var->dim->value === 'function';
}); 09.10.2020
upgrade_status 8.x-2.11 ::
tests/modules/upgrade_status_test_theme_functions/upgrade_status_test_theme_functions.module
/**
* Implements hook_theme_registry_alter().
*/
function upgrade_status_test_theme_functions_theme_registry_alter(&$theme_registry) {
$theme_registry['upgrade_status_test_theme_function_another_function']['function'] = 'upgrade_status_test_theme_function';
$theme_registry['upgrade_status_test_theme_function_non_existing_function']['function'] = sprintf('upgrade_status_test_theme_function');
}
/**
* Theme function used for testing. 22.09.2020
uswds 8.x-2.1-rc1 ::
includes/base_themes.inc
/**
* Implements hook_theme_registry_alter().
*/
function uswds_theme_registry_alter(&$registry) {
$trail = uswds_theme_trail();
// For the purpose of this, we want the theme trail in reverse order: from
// root base theme to active theme. This way we can let base themes run their
// functions before the active theme.
$trail = array_reverse($trail); 19.07.2021
uswds_blb_configuration 1.0.0-beta2 ::
modules/uswds_blb_configuration_media_library/uswds_blb_configuration_media_library.module
/**
* Implements hook_theme_registry_alter().
*
* Add the Claro Media Library templates with their default Claro settings if
* they not yet exist in to the active theme registry.
*/
function uswds_blb_configuration_media_library_theme_registry_alter(&$theme_registry) {
/** @var \Drupal\Core\Extension\ThemeHandler $themeHandler */
$themeHandler = \Drupal::service('theme_handler');
$claroThemePath = $themeHandler->getTheme('claro')->getPath();
if (!in_array('media', $theme_registry)) {
$template = 'media'; 24.01.2023
varbase_dashboards 1.0.x-dev ::
varbase_dashboards.module
/**
* Implements hook_theme_registry_alter().
*/
function varbase_dashboards_theme_registry_alter(&$info) {
if (\Drupal::service('theme.manager')->getActiveTheme()->getName() === \Drupal::config('system.theme')->get('admin')) {
$active_theme = \Drupal::theme()->getActiveTheme()->getName();
$base_theme_extensions = \Drupal::theme()->getActiveTheme()->getBaseThemeExtensions();
if ($active_theme === 'gin' || in_array('gin', array_keys($base_theme_extensions))) { 18.10.2020
varbase_media 9.0.0-alpha1 ::
varbase_media.module
/**
* Implements hook_theme_registry_alter().
*/
function varbase_media_theme_registry_alter(&$theme_registry) {
// Varbase Media path.
if (isset($theme_registry['entity_embed_container'])) {
$varbase_media_path = Drupal::service('module_handler')->getModule('varbase_media')->getPath();
$theme_registry['entity_embed_container']['path'] = $varbase_media_path . '/templates';
} 08.02.2020
vefl 8.x-2.x-dev ::
vefl.module
/**
* Implements hook_theme_registry_alter().
*/
function vefl_theme_registry_alter(&$theme_registry) {
// Inserts default views preprocess function before vefl preprocess function.
$before = array_search('template_preprocess_vefl_views_exposed_form', $theme_registry['vefl_views_exposed_form']['preprocess functions']);
array_splice($theme_registry['vefl_views_exposed_form']['preprocess functions'], $before, 0, ['template_preprocess_views_exposed_form']);
}
/** 06.04.2021
views_delimited_list 2.x-dev ::
views_delimited_list.module
/**
* Implements hook_theme_registry_alter().
*/
function views_delimited_list_theme_registry_alter(&$hooks) {
// Copy variables from the original theme hook.
$hooks['views_delimited_list_fields']['variables'] = $hooks['views_view_fields']['variables'];
$hooks['views_view_delimited_list']['variables'] = $hooks['views_view']['variables'];
}
/** 13.09.2019
views_group_action 8.x-1.x-dev ::
modules/views_group_action_bootstrap/views_group_action_bootstrap.module
/**
* Implements hook_theme_registry_alter().
*/
function views_group_action_bootstrap_theme_registry_alter(&$theme_registry) {
$themes_with_group_action_form = [
'views_bootstrap_grid_group_action',
'views_bootstrap_list_group_group_action',
'views_bootstrap_table_group_action',
];
_views_group_action_theme_alter_helper($theme_registry, $themes_with_group_action_form); 13.09.2019
views_group_action 8.x-1.x-dev ::
modules/views_group_action_footable/views_group_action_footable.module
/**
* Implements hook_theme_registry_alter().
*/
function views_group_action_footable_theme_registry_alter(&$theme_registry) {
$themes_with_group_action_form = [
'views_view_footable_group_action',
];
_views_group_action_theme_alter_helper($theme_registry, $themes_with_group_action_form);
} 13.09.2019
views_group_action 8.x-1.x-dev ::
views_group_action.module
/**
* Implements hook_theme_registry_alter().
*/
function views_group_action_theme_registry_alter(&$theme_registry) {
$themes_with_group_action_form = [
'views_view_unformatted_group_action',
'views_view_grid_group_action',
'views_view_list_group_action',
'views_view_table_group_action',
]; 06.08.2020
views_rss 8.x-2.x-dev ::
views_rss.module
/**
* Implements hook_theme_registry_alter().
*/
function views_rss_theme_registry_alter(array &$registry) {
$module_dir = \Drupal::service('extension.list.module')->getPath('views_rss');
// Use the twig file that comes with this module so that the CDATA wrapper can
// be added.
$registry['views_view_row_rss']['path'] = $module_dir . '/templates'; 26.07.2022
views_rss_yandex 2.0.0 ::
views_rss_yandex.module
/**
* Implements hook_theme_registry_alter().
*/
function views_rss_yandex_theme_registry_alter(array &$registry) {
// Use the twig file that comes with this module so that the CDATA wrapper can
// be added.
$module_dir = \Drupal::service('extension.list.module')->getPath('views_rss_yandex');
$registry['views_view_row_rss']['path'] = $module_dir . '/templates';
} 02.06.2020
webform_calculation 8.x-1.0 ::
webform_calculation.module
/**
* Implements hook_theme_registry_alter().
*
* Adds ability to use template files for webform result outside of the folder
* with themes.
*/
function webform_calculation_theme_registry_alter(&$theme_registry) {
$templates = drupal_find_theme_templates($theme_registry, twig_extension(), WEBFORM_CALCULATION_LIBRARY);
foreach ($templates as $template => $info) {
$templates[$template]['type'] = isset($templates[$template]['type']) ? $templates[$template]['type'] : 'theme_engine';
$templates[$template]['preprocess functions'] = [
'template_preprocess_webform',
]; 16.08.2018
widget_engine 8.x-1.2 ::
widget_engine.module
/**
* Implements hook_theme_registry_alter().
*/
function widget_engine_theme_registry_alter(&$theme_registry) {
$theme_registry['inline_entity_form_entity_table']['function'] = 'theme_widget_engine_form_entity_table';
}
/**
* Themes the table showing existing entity references in the widget.
*/ 12.08.2024
ws_small_y 1.0.x-dev ::
ws_small_y.module
/**
* Implements hook_theme_registry_alter().
*/
function ws_small_y_theme_registry_alter(&$theme_registry) {
$path = 'modules/contrib/ws_small_y';
$override_components = [
'block__ws_search_bar',
'menu__extras',
'menu__main',
]; 