function hook_block_info_alter

Change block definition before saving to the database.

Parameters

$blocks: A multidimensional array of blocks keyed by the defining module and delta; the values are blocks returned by hook_block_info(). This hook is fired after the blocks are collected from hook_block_info() and the database, right before saving back to the database.

$theme: The theme these blocks belong to.

$code_blocks: The blocks as defined in hook_block_info() before being overwritten by the database data.

See also

hook_block_info()

Related topics

2 functions implement hook_block_info_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

block_test_block_info_alter in modules/block/tests/block_test.module
Implements hook_block_info_alter().
dashboard_block_info_alter in modules/dashboard/dashboard.module
Implements hook_block_info_alter().
1 invocation of hook_block_info_alter()
_block_rehash in modules/block/block.module
Updates the 'block' DB table with the blocks currently exported by modules.

File

modules/block/block.api.php, line 136

Code

function hook_block_info_alter(&$blocks, $theme, $code_blocks) {
    // Disable the login block.
    $blocks['user']['login']['status'] = 0;
}

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