Skip to content

Instantly share code, notes, and snippets.

@perifer
Created July 15, 2009 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perifer/147607 to your computer and use it in GitHub Desktop.
Save perifer/147607 to your computer and use it in GitHub Desktop.
<?php
/**
* Override theme_block() to disable rendering of blocks.
*/
function YOURTHEME_blocks($region) {
$output = '';
// Right region and on the node form.
$node_form = ($region == 'right' && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'));
if (!$node_form) {
if ($list = block_list($region)) {
foreach ($list as $key => $block) {
// $key == <i>module</i>_<i>delta</i>
$output .= theme('block', $block);
}
}
// Add any content assigned to this region through drupal_set_content() calls.
$output .= drupal_get_content($region);
}
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment