block_flush_caches

6 block.module block_flush_caches()
7 block.module block_flush_caches()

Implementation of hook_flush_caches().

File

modules/block/block.module, line 318
Controls the boxes that are displayed around the main content.

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.
  $result = db_query("SELECT name FROM {system} WHERE type = 'theme' AND status = 1");
  while ($theme = db_result($result)) {
    _block_rehash($theme);
  }
}

Comments

Just found that you'll have

Just found that you'll have to call _block_rehash('MY_THEME_NAME') explicitly if you're trying to flush the block cache for a particular theme within an update function (hook_update_N), otherwise you're flushing the block cache for the Garland theme and not for your normal site theme, since Garland is the active theme during updates.

Login or register to post comments