Same name in other branches
  1. 5.0.x advagg.module \advagg_module_implements_alter()
  2. 6.0.x advagg.module \advagg_module_implements_alter()
  3. 7.x-2.x advagg.module \advagg_module_implements_alter()
  4. 8.x-3.x advagg.module \advagg_module_implements_alter()
  5. 8.x-4.x advagg.module \advagg_module_implements_alter()

Implements hook_module_implements_alter().

Move advagg' and various submodule's implementations to last.

Fichier

./advagg.module, line 39

Code

function advagg_module_implements_alter(&$implementations, $hook) {
    if ($hook === 'js_alter' && isset($implementations['advagg'])) {
        // Move advagg and advagg_mod to the bottom, advagg is above advagg_mod.
        $item = $implementations['advagg'];
        unset($implementations['advagg']);
        $implementations['advagg'] = $item;
        if (isset($implementations['advagg_mod'])) {
            $item = $implementations['advagg_mod'];
            unset($implementations['advagg_mod']);
            $implementations['advagg_mod'] = $item;
        }
    }
    elseif ($hook === 'css_alter' && isset($implementations['advagg'])) {
        $item = $implementations['advagg'];
        unset($implementations['advagg']);
        $implementations['advagg'] = $item;
        if (isset($implementations['advagg_mod'])) {
            $item = $implementations['advagg_mod'];
            unset($implementations['advagg_mod']);
            $implementations['advagg_mod'] = $item;
        }
    }
    if ($hook === 'file_url_alter' && isset($implementations['advagg'])) {
        $item = $implementations['advagg'];
        unset($implementations['advagg']);
        $implementations['advagg'] = $item;
    }
    if ($hook === 'requirements') {
        if (isset($implementations['advagg'])) {
            $item = $implementations['advagg'];
            unset($implementations['advagg']);
            $implementations['advagg'] = $item;
        }
        if (isset($implementations['advagg_cdn'])) {
            $item = $implementations['advagg_cdn'];
            unset($implementations['advagg_cdn']);
            $implementations['advagg_cdn'] = $item;
        }
        if (isset($implementations['advagg_css_minify'])) {
            $item = $implementations['advagg_css_minify'];
            unset($implementations['advagg_css_minify']);
            $implementations['advagg_css_minify'] = $item;
        }
        if (isset($implementations['advagg_js_minify'])) {
            $item = $implementations['advagg_js_minify'];
            unset($implementations['advagg_js_minify']);
            $implementations['advagg_js_minify'] = $item;
        }
    }
}