You are here

function lazy_preprocess_image in Lazy-load 8.3

Same name and namespace in other branches
  1. 8 lazy.module \lazy_preprocess_image()
  2. 8.2 lazy.module \lazy_preprocess_image()

Implements template_preprocess_image().

File

./lazy.module, line 241
Module file for Lazy-load.

Code

function lazy_preprocess_image(&$variables) {
  if (array_key_exists('data-lazy', $variables['attributes'])) {
    lazy_process_variables($variables);

    // We don't need `data-lazy` attribute anymore.
    unset($variables['attributes']['data-lazy']);
  }
}