You are here

function block_modules_installed in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/block/block.module \block_modules_installed()

Implements hook_modules_installed().

See also

block_themes_installed()

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);
    }
  }
}