You are here

function hook_lazyloader_alter in Image Lazyloader 8

Alters asset lazyloading.

Settings $vars['lazyloader_ignore'] = TRUE will skip lazyloading for that asset.

Parameters

array $vars: The variables passed in a theme_[responsive_]image() call.

1 invocation of hook_lazyloader_alter()
_lazyloader_alter in ./lazyloader.module
Allow modules to modify assets prior to modification or skip it altogether.

File

./lazyloader.api.php, line 22
Hooks provided by the Lazyloader module.

Code

function hook_lazyloader_alter(array &$vars) {

  // Skip lazyloading based on the result of some_condition().
  if (some_condition($vars)) {
    $vars['lazyloader_ignore'] = TRUE;
  }
}