You are here

function node_test_entity_view_mode_alter in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/node/tests/modules/node_test/node_test.module \node_test_entity_view_mode_alter()
  2. 9 core/modules/node/tests/modules/node_test/node_test.module \node_test_entity_view_mode_alter()

Implements hook_entity_view_mode_alter().

File

modules/node/tests/node_test.module, line 158
A dummy module for testing node related hooks.

Code

function node_test_entity_view_mode_alter(&$view_mode, $context) {

  // Only alter the view mode if we are on the test callback.
  if ($change_view_mode = variable_get('node_test_change_view_mode', '')) {
    $view_mode = $change_view_mode;
  }
}