You are here

function hook_blazy_settings_alter in Blazy 7

Same name and namespace in other branches
  1. 8.2 blazy.api.php \hook_blazy_settings_alter()

Alters blazy settings inherited by all child elements.

Parameters

array $build: The array containing: settings, or potential optionset for extensions.

object $items: The Drupal\Core\Field\FieldItemListInterface items.

Related topics

2 invocations of hook_blazy_settings_alter()
BlazyFilter::process in src/Plugin/Filter/BlazyFilter.php
BlazyFormatter::preBuildElements in src/BlazyFormatter.php

File

./blazy.api.php, line 279
Hooks and API provided by the Blazy module.

Code

function hook_blazy_settings_alter(array &$build, $items) {
  $settings =& $build['settings'];

  // Overrides one pixel placeholder on particular pages relevant if using Views
  // rewrite results which may strip out Data URI.
  // See https://drupal.org/node/2908861.
  if (isset($settings['entity_id']) && in_array($settings['entity_id'], [
    45,
    67,
  ])) {
    $settings['placeholder'] = 'https://mysite.com/blank.gif';
  }
}