function hook_entity_view_mode_info_alter
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_view_mode_info_alter()
- 8.9.x core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_view_mode_info_alter()
- 11.x 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
Code
function hook_entity_view_mode_info_alter(&$view_modes) {
$view_modes['user']['full']['status'] = TRUE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.