Skip to content

Instantly share code, notes, and snippets.

@swichers
Created June 19, 2015 23:49
Show Gist options
  • Save swichers/b02e9576be71610739b0 to your computer and use it in GitHub Desktop.
Save swichers/b02e9576be71610739b0 to your computer and use it in GitHub Desktop.
The proper way to load and render a block in Drupal 7
<?php
// Other methods bypass certain hooks or skip parts of the theme layer.
$block = block_load($module, $delta);
$renderable_block = _block_get_renderable_array(_block_render_blocks(array($block)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment