1 node.module node_field_display_node_alter(&$display, $context)

Implements hook_field_display_ENTITY_TYPE_alter().

File

core/modules/node/node.module, line 216
The core module that allows content to be submitted to the site.

Code

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