function media_test_ckeditor_entity_view_alter in Drupal 8
Implements hook_entity_view_alter().
File
- core/
modules/ media/ tests/ modules/ media_test_ckeditor/ media_test_ckeditor.module, line 14 - Helper module for the Media Embed CKEditor plugin tests.
Code
function media_test_ckeditor_entity_view_alter(&$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
// @see \Drupal\Tests\media\FunctionalJavascript\CKEditorIntegrationTest::testPreviewUsesDefaultThemeAndIsClientCacheable()
$build['#attributes']['data-media-embed-test-active-theme'] = \Drupal::theme()
->getActiveTheme()
->getName();
}