You are here

function fieldblock_module_implements_alter in Field as Block 7

Implements hook_module_implements_alter().

File

./fieldblock.module, line 13
Allow fields to be rendered in blocks.

Code

function fieldblock_module_implements_alter(&$implementations, $hook) {

  // Move these hooks to the end of the execution list. Even though Fieldblock only implements
  // hook_entity_view_alter, module_implements() indexes them by first-called, which is the most
  // specific, so we need those too.
  $view_alter_hooks = array(
    'entity_view_alter',
    'node_view_alter',
    'taxonomy_term_alter',
    'user_view_alter',
  );
  if (in_array($hook, $view_alter_hooks) && isset($implementations['fieldblock'])) {
    $group = $implementations['fieldblock'];
    unset($implementations['fieldblock']);
    $implementations['fieldblock'] = $group;
  }
}