function media_test_embed_entity_view_alter
Same name in other branches
- 9 core/modules/media/tests/modules/media_test_embed/media_test_embed.module \media_test_embed_entity_view_alter()
- 10 core/modules/media/tests/modules/media_test_embed/media_test_embed.module \media_test_embed_entity_view_alter()
Implements hook_entity_view_alter().
File
-
core/
modules/ media/ tests/ modules/ media_test_embed/ media_test_embed.module, line 18
Code
function media_test_embed_entity_view_alter(&$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
$build['#attributes']['data-media-embed-test-active-theme'] = \Drupal::theme()->getActiveTheme()
->getName();
$build['#attributes']['data-media-embed-test-view-mode'] = $display->getMode();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.