function node_field_display_node_alter

7.x node.module node_field_display_node_alter(&$display, $context)

Implements hook_field_display_ENTITY_TYPE_alter().

File

drupal/modules/node/node.module, line 239
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_field_display_node_alter(&$display, $context) {
  // Hide field labels in search index.
  if ($context['view_mode'] == 'search_index') {
    $display['label'] = 'hidden';
  }
}