Created
September 21, 2012 16:24
-
-
Save EclipseGc/3762463 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function _block_get_renderable_block($element) { | |
$block = $element['#block']; | |
// Don't bother to build blocks that aren't accessible. | |
if ($element['#access'] = $block->access()) { | |
$build = $block->build(); | |
if ($build) { | |
if (isset($build['#title'])) { | |
$element['#title'] = $build['#title']; | |
} | |
$element += $build; | |
} | |
else { | |
$element = array(); | |
} | |
} | |
return $element; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment