function block_themes_installed

Same name and namespace in other branches
  1. 9 core/modules/block/block.module \block_themes_installed()
  2. 8.9.x core/modules/block/block.module \block_themes_installed()
  3. 11.x core/modules/block/block.module \block_themes_installed()

Initializes blocks for installed themes.

Parameters

$theme_list: An array of theme names.

See also

block_modules_installed()

File

core/modules/block/block.module, line 94

Code

function block_themes_installed($theme_list) {
  // Disable this functionality prior to install profile installation because
  // block configuration is often optional or provided by the install profile
  // itself. block_theme_initialize() will be called when the install profile is
  // installed.
  if (InstallerKernel::installationAttempted() && \Drupal::config('core.extension')->get('module.' . \Drupal::installProfile()) === NULL) {
    return;
  }
  foreach ($theme_list as $theme) {
    // Don't initialize themes that are not displayed in the UI.
    if (\Drupal::service('theme_handler')->hasUi($theme)) {
      block_theme_initialize($theme);
    }
  }
}

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