You are here

function block_flush_caches in Drupal 7

Same name and namespace in other branches
  1. 6 modules/block/block.module \block_flush_caches()

Implements hook_flush_caches().

1 call to block_flush_caches()
system_update_7053 in modules/system/system.install
Upgrade standard blocks and menus.

File

modules/block/block.module, line 987
Controls the visual building blocks a page is constructed with.

Code

function block_flush_caches() {

  // Rehash blocks for active themes. We don't use list_themes() here,
  // because if MAINTENANCE_MODE is defined it skips reading the database,
  // and we can't tell which themes are active.
  $themes = db_query("SELECT name FROM {system} WHERE type = 'theme' AND status = 1");
  foreach ($themes as $theme) {
    _block_rehash($theme->name);
  }
  return array(
    'cache_block',
  );
}