function block_modules_installed in Drupal 9
Implements hook_modules_installed().
See also
File
- core/
modules/ block/ block.module, line 152 - Controls the visual building blocks a page is constructed with.
Code
function block_modules_installed($modules) {
// block_themes_installed() does not call block_theme_initialize() during site
// installation because block configuration can be optional or provided by the
// profile. Now, when the profile is installed, this configuration exists,
// call block_theme_initialize() for all installed themes.
$profile = \Drupal::installProfile();
if (in_array($profile, $modules, TRUE)) {
foreach (\Drupal::service('theme_handler')
->listInfo() as $theme => $data) {
block_theme_initialize($theme);
}
}
}