function dashboard_block_list_alter

7.x dashboard.module dashboard_block_list_alter(&$blocks)

Implements hook_block_list_alter().

Skip rendering dashboard blocks when not on the dashboard page itself. This prevents expensive dashboard blocks from causing performance issues on pages where they will never be displayed.

File

drupal/modules/dashboard/dashboard.module, line 124
Provides a dashboard page in the administrative interface.

Code

function dashboard_block_list_alter(&$blocks) {
  if (!dashboard_is_visible()) {
    foreach ($blocks as $key => $block) {
      if (in_array($block->region, dashboard_regions())) {
        unset($blocks[$key]);
      }
    }
  }
}