Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_view_mode_info_alter()
  2. 9 core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_view_mode_info_alter()

Alter the view modes for entity types.

Parameters

array $view_modes: An array of view modes, keyed first by entity type, then by view mode name.

See also

\Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllViewModes()

\Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModes()

Related topics

1 function implements hook_entity_view_mode_info_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_test_entity_view_mode_info_alter in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_entity_view_mode_info_alter().

File

core/lib/Drupal/Core/Entity/entity.api.php, line 861
Hooks and documentation related to entities.

Code

function hook_entity_view_mode_info_alter(&$view_modes) {
  $view_modes['user']['full']['status'] = TRUE;
}