function hook_block_info_alter

hook_block_info_alter(&$blocks, $theme, $code_blocks)

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

File

modules/block/block.api.php, line 136
Hooks provided by the Block module.

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!block!block.api.php/function/hook_block_info_alter/7.x