media_test_oembed.module
Same filename in other branches
File
-
core/
modules/ media/ tests/ modules/ media_test_oembed/ media_test_oembed.module
View source
<?php
/**
* @file
* Helper module for the Media oEmbed tests.
*/
declare (strict_types=1);
/**
* Implements hook_preprocess_media_oembed_iframe().
*/
function media_test_oembed_preprocess_media_oembed_iframe(array &$variables) {
if ($variables['resource']->getProvider()
->getName() === 'YouTube') {
$variables['media'] = str_replace('?feature=oembed', '?feature=oembed&pasta=rigatoni', (string) $variables['media']);
}
// @see \Drupal\Tests\media\Kernel\OEmbedIframeControllerTest
$variables['#attached']['library'][] = 'media_test_oembed/frame';
$variables['#cache']['tags'][] = 'yo_there';
}
Functions
Title | Deprecated | Summary |
---|---|---|
media_test_oembed_preprocess_media_oembed_iframe | Implements hook_preprocess_media_oembed_iframe(). |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.