You are here

function lazy_field_formatter_info_alter in Lazy-load 8.3

Implements hook_field_formatter_info_alter().

File

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

Code

function lazy_field_formatter_info_alter(array &$info) {
  $moduleHandler = \Drupal::moduleHandler();
  if (isset($info['lazy_image']) && !$moduleHandler
    ->moduleExists('image')) {
    unset($info['lazy_image']);
  }
  if (isset($info['lazy_responsive_image']) && !$moduleHandler
    ->moduleExists('responsive_image')) {
    unset($info['lazy_responsive_image']);
  }
}