function drupal_theme_rebuild

Same name in other branches
  1. 7.x includes/theme.inc \drupal_theme_rebuild()
  2. 8.9.x core/includes/theme.inc \drupal_theme_rebuild()
  3. 10 core/includes/theme.inc \drupal_theme_rebuild()

Forces the system to rebuild the theme registry.

This function should be called when modules are added to the system, or when a dynamic system needs to add more theme hooks.

7 calls to drupal_theme_rebuild()
ImageStyle::flush in core/modules/image/src/Entity/ImageStyle.php
Flushes cached media for this style.
ModuleInstaller::install in core/lib/Drupal/Core/Extension/ModuleInstaller.php
Installs a given list of modules.
ModuleInstaller::uninstall in core/lib/Drupal/Core/Extension/ModuleInstaller.php
Uninstalls a given list of modules.
ThemeInstaller::themeRegistryRebuild in core/lib/Drupal/Core/Extension/ThemeInstaller.php
Wraps drupal_theme_rebuild().
ThemeTest::testPreprocessForSuggestions in core/modules/system/tests/src/Functional/Theme/ThemeTest.php
Ensures preprocess functions run even for suggestion implementations.

... See full list

File

core/includes/theme.inc, line 122

Code

function drupal_theme_rebuild() {
    \Drupal::service('theme.registry')->reset();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.