Results
07.10.2020
module_builder 8.x-3.x-dev ::
tests/sample_hook_definitions/7/hooks_processed.php
";}s:25:"hook_theme_registry_alter";a:9:{s:4:"type";s:4:"hook";s:4:"name";s:25:"hook_theme_registry_alter";s:10:"definition";s:52:"function hook_theme_registry_alter(&$theme_registry)";s:11:"description";s:64:"Alter the theme registry information returned from hook_theme().";s:11:"destination";s:14:"%module.module";s:12:"dependencies";a:0:{}s:5:"group";s:6:"system";s:9:"file_path";s:48:"/Users/joachim/bin/drupal_hooks/7/system.api.php";s:4:"body";s:319:"
// Kill the next/previous forum topic navigation links.
foreach ($theme_registry['forum_topic_navigation']['preprocess functions'] as $key => $value) {
if ($value == 'template_preprocess_forum_topic_navigation') {
unset($theme_registry['forum_topic_navigation']['preprocess functions'][$key]);
}
} 13.04.2020
module_filter 8.x-3.x-dev ::
module_filter.module
/**
* Implements hook_theme_registry_alter().
*/
function module_filter_theme_registry_alter(&$theme_registry): void {
// We need to alter the system-modules-details template, so we can add
// applicable requires and required-by classes.
$theme_registry['system_modules_details']['path'] = \Drupal::service('extension.list.module')->getPath('module_filter') . '/templates';
}
/** 18.02.2025
module_matrix 1.0.2 ::
module_matrix.module
/**
* Implements hook_theme_registry_alter().
*/
function module_matrix_theme_registry_alter(array &$theme_registry): void {
$templates = [
'system_modules_uninstall' => 'system-modules-uninstall',
'system_modules_details' => 'system-modules-details',
];
$module_path = \Drupal::service('extension.list.module')->getPath('module_matrix') . '/templates'; 06.03.2025
navigation_plus 1.0.5 ::
navigation_plus.module
/**
* Implements hook_theme_registry_alter().
*/
function navigation_plus_theme_registry_alter(&$theme_registry) {
$path = Drupal::service('module_handler')->getModule('navigation_plus')->getPath();
$theme_registry['top_bar']['path'] = "$path/templates";
// Ensure our theme hooks run last.
foreach (['navigation', 'top_bar'] as $hook) {
if (!empty($theme_registry[$hook]['preprocess functions'])) { 26.02.2018
og_sm 8.x-1.0 ::
og_sm_content/og_sm_content.module
/**
* Implements hook_theme_registry_alter().
*/
function og_sm_content_theme_registry_alter(&$theme_registry) {
if (!isset($theme_registry['node_add_list'])) {
return;
}
$preprocess_functions = $theme_registry['node_add_list']['preprocess functions'];
$key = array_search('og_sm_content_preprocess_node_add_list', $preprocess_functions);
if ($key !== FALSE) { 20.09.2021
openy_socrates 1.0.2 ::
modules/openy_theme_override/openy_theme_override.module
/**
* Implements hook_theme_registry_alter().
*/
function openy_theme_override_theme_registry_alter(&$theme_registry) {
$regex = '/' . str_replace('.', '\\.', "html.twig") . '$/';
$overrides = \Drupal::service('file_system')->scanDirectory(\Drupal::service('extension.list.module')->getPath('openy_theme_override') . '/themes', $regex, ['nomask' => TRUE], 100);
$themes = scandir(\Drupal::service('extension.list.module')->getPath('openy_theme_override') . '/themes');
unset($themes[1]);
unset($themes[0]);
$themes = array_values($themes); 18.08.2020
opigno_calendar 8.x-1.7 ::
opigno_calendar.module
/**
* Implements hook_theme_registry_alter().
*/
function opigno_calendar_theme_registry_alter(&$theme_registry) {
$theme_registry['calendar_month_col']['path'] = \Drupal::service('extension.list.module')->getPath('opigno_calendar') . '/templates';
}
/**
* Implements hook_preprocess_HOOK().
*/ 02.06.2020
page_manager 8.x-4.0-beta6 ::
page_manager_ui/page_manager_ui.module
/**
* Implements hook_theme_registry_alter().
*
* @todo Refactor/remove if https://www.drupal.org/project/drupal/issues/3005403 lands.
*/
function page_manager_ui_theme_registry_alter(&$theme_registry) {
// Seven removes all block contextual links via a preprocess.
// Layout builder variants require contextual links to configure blocks.
// @see https://www.drupal.org/project/drupal/issues/2487025
if (!empty($theme_registry['block']['preprocess functions'])) {
$preprocess_functions = &$theme_registry['block']['preprocess functions']; 06.02.2020
panopoly_media 8.x-2.x-dev ::
panopoly_media.module
/**
* Implements hook_theme_registry_alter().
*/
function panopoly_media_theme_registry_alter(&$theme_registry) {
// If in Olivero, replace the HTML template for the entity browser modal.
if (isset($theme_registry['block']['preprocess functions']) && in_array('olivero_preprocess_block', $theme_registry['block']['preprocess functions'])) {
/** @var \Drupal\Core\Extension\ModuleExtensionList $moduleList */
$moduleList = \Drupal::service('extension.list.module');
// Ensure that we're using the module version of the template, and not 16.02.2020
paragraphs 8.x-1.11 ::
paragraphs.module
/**
* Implements hook_theme_registry_alter().
*/
function paragraphs_theme_registry_alter(&$theme_registry) {
// Force paragraphs_preprocess_field_multiple_value_form to run last.
$key = array_search('paragraphs_preprocess_field_multiple_value_form', $theme_registry['field_multiple_value_form']['preprocess functions']);
unset($theme_registry['field_multiple_value_form']['preprocess functions'][$key]);
$theme_registry['field_multiple_value_form']['preprocess functions'][] = 'paragraphs_preprocess_field_multiple_value_form';
} 06.07.2020
paragraphs_grid 8.x-1.3 ::
paragraphs_grid.module
/**
* Implements hook_theme_registry_alter().
*/
function paragraphs_grid_theme_registry_alter(&$theme_registry) {
$theme_registry['field__entity_reference_revisions'] = $theme_registry['field'];
$theme_registry['field__entity_reference_revisions']['template'] = 'field--paragraphs-grid-formatter';
$theme_registry['field__entity_reference_revisions']['path'] = \Drupal::service('extension.list.module')->getPath('paragraphs_grid') . '/templates';
}
/** 15.05.2019
paragraphs_tools 8.x-1.0-beta5 ::
paragraphs_tools_tweaks/paragraphs_tools_tweaks.module
/**
* Implements hook_theme_registry_alter().
*/
function paragraphs_tools_tweaks_theme_registry_alter(&$theme_registry) {
$hookImplementations =& $theme_registry['field_multiple_value_form']['preprocess functions'];
$hookImplementationKey = array_search('paragraphs_tools_tweaks_preprocess_field_multiple_value_form', $hookImplementations);
unset($hookImplementations[$hookImplementationKey]);
$hookImplementations[] = 'paragraphs_tools_tweaks_preprocess_field_multiple_value_form';
$hookImplementations = array_values($hookImplementations);
} 07.06.2020
passwd_only 8.x-1.x-dev ::
passwd_only_logintoboggan/passwd_only_logintoboggan.module
/**
* Implements hook_theme_registry_alter().
*/
function passwd_only_logintoboggan_theme_registry_alter(&$theme_registry) {
if (!empty($theme_registry['lt_unified_login_page']['function'])) {
$theme_registry['lt_unified_login_page']['function'] = 'passwd_only_logintoboggan_lt_unified_login_page';
$theme_registry['lt_unified_login_page']['variables']['passwd_only_form'] = NULL;
}
}
* Preprocess function for passwd_only_logintoboggan_lt_unified_login_page().
*
* @see passwd_only_logintoboggan_theme_registry_alter()
* @see passwd_only_logintoboggan_lt_unified_login_page()
*/
function passwd_only_logintoboggan_preprocess_lt_unified_login_page(&$variables) {
$variables['passwd_only_form'] = \Drupal::service('renderer')->render(drupal_get_form('passwd_only_login_form'));
} 15.10.2019
patchinfo 8.x-2.x-dev ::
patchinfo.module
/**
* Implements hook_theme_registry_alter().
*/
function patchinfo_theme_registry_alter(&$theme_registry) {
$module_path = \Drupal::service('extension.list.module')->getPath('patchinfo');
if (isset($theme_registry['update_report'])) {
// Replace template location for update report with our own templates
// folder, so that we can alter the template.
$theme_registry['update_report']['path'] = $module_path . '/templates'; 15.03.2023
picture_everywhere 1.0.0 ::
picture_everywhere.module
/**
* Implements hook_theme_registry_alter().
*/
function picture_everywhere_theme_registry_alter(array &$theme_registry): void {
$config = \Drupal::config('picture_everywhere.settings');
$enabled_themes = $config->get('themes');
if (!$enabled_themes) {
return;
} 06.11.2022
postoffice 1.0.x-dev ::
extensions/postoffice_image/postoffice_image.module
/**
* Implements hook_theme_registry_alter().
*/
function postoffice_image_theme_registry_alter(&$theme_registry) {
$theme_registry['image_formatter']['variables'] += [
'postoffice_image_adjustment' => '',
];
$theme_registry['image_style']['variables'] += [
'postoffice_image_embed_target_id' => 0,
'postoffice_image_embed_style_name' => '', 06.11.2022
postoffice 1.0.x-dev ::
extensions/postoffice_file/postoffice_file.module
/**
* Implements hook_theme_registry_alter().
*/
function postoffice_file_theme_registry_alter(&$theme_registry) {
$theme_registry['file_link']['variables'] += [
'postoffice_file_adjustment' => '',
];
}
/** 04.04.2024
ppf 1.2.x-dev ::
ppf.module
/**
* Implements hook_theme_registry_alter().
*/
function ppf_theme_registry_alter(&$theme_registry) : void {
// Get all files.
$allFiles = [
'theme' => PreprocessorFiles::getPreprocessorFilesForTheme(),
'modules' => PreprocessorFiles::getPreprocessorFilesForActiveModules(),
]; 06.10.2020
preprocess 2.0.0 ::
preprocess.module
/**
* Implements hook_theme_registry_alter().
*/
function preprocess_theme_registry_alter(array &$theme_registry): void {
$implementation = 'preprocess_preprocess';
foreach ($theme_registry as $theme => $item) {
$preprocessor_key = array_search($implementation, $item['preprocess functions'] ?? [], TRUE);
if ($preprocessor_key === FALSE) {
continue;
} 19.02.2020
preprocessors 8.x-1.0-beta8 ::
preprocessors.module
/**
* Implements hook_theme_registry_alter().
*/
function preprocessors_theme_registry_alter(&$theme_registry) : void {
// Load our Preprocessor Plugins first. If there are none, we can stop here.
$plugins = Preprocessors::service()->getPreprocessorPlugins();
if (empty($plugins)) {
return;
} 