Skip to content

Instantly share code, notes, and snippets.

@LarsEliasNielsen
Last active August 29, 2015 13:56
Show Gist options
  • Save LarsEliasNielsen/9324180 to your computer and use it in GitHub Desktop.
Save LarsEliasNielsen/9324180 to your computer and use it in GitHub Desktop.
Drupal 7 Module Development: Module Block
<?php
/**
* Implements hook_block_info().
*
* Declares a block to provide to Drupal. This can also specify block
* configuration settings, like here where the cache is determined be the
* user role.
*
* @url: https://api.drupal.org/api/drupal/modules!block!block.api.php/function/hook_block_info/7
*/
function espn_news_block_info() {
$blocks['espn_news'] = array(
'info' => t('ESPN News'),
'cache' => DRUPAL_CACHE_PER_ROLE,
);
return $blocks;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment