You are here

function blazy_test_pre_render in Blazy 8

The #pre_render callback: Sets blazy_test related URL attributes.

1 string reference to 'blazy_test_pre_render'
blazy_test_blazy_alter in tests/modules/blazy_test/blazy_test.module
Implements hook_blazy_attach_alter().

File

tests/modules/blazy_test/blazy_test.module, line 60
Testing various Blazy hooks, etc.

Code

function blazy_test_pre_render($image) {
  $settings = isset($image['#settings']) ? $image['#settings'] : [];

  // Video's HREF points to external site, adds URL to local image.
  if (!empty($settings['box_url']) && !empty($settings['embed_url'])) {
    $image['#url_attributes']['data-box-url'] = $settings['box_url'];
  }
  return $image;
}