You are here

function hook_regions_blocks_alter in Regions 7

Same name and namespace in other branches
  1. 6 regions.api.php \hook_regions_blocks_alter()

Hook allowing other modules to alter any newly defined regions blocks.

This happens before the each block object is rendered by theme_block().

Parameters

array $blocks: A keyed array of block objects provided by core block and context modules.

string $region_name: machine name of the region.

See also

_regions_blocks()

theme_block()

1 invocation of hook_regions_blocks_alter()
_regions_blocks in ./regions.module
Helper function to get a list of blocks per region.

File

./regions.api.php, line 76
Hooks provided by Regions.

Code

function hook_regions_blocks_alter(&$blocks = array(), $region_name = NULL) {

  // Example to support HTML titles, with a safe but unorthodox workaround.
  foreach ($blocks as $key => $block) {
    $block->subject = filter_xss_admin(html_entity_decode($block->subject));
    $blocks[$key] = $block;
  }
}