Same name and namespace in other branches
  1. 5.0.x advagg_mod/advagg_mod.module \advagg_mod_css_defer_active() 1 commentaire
  2. 8.x-2.x advagg_mod/advagg_mod.module \advagg_mod_css_defer_active() 1 commentaire
  3. 8.x-3.x advagg_mod/advagg_mod.module \advagg_mod_css_defer_active() 1 commentaire
  4. 8.x-4.x advagg_mod/advagg_mod.module \advagg_mod_css_defer_active() 1 commentaire

Determines whether css defering should be active for the current request.

2 calls to advagg_mod_css_defer_active()
advagg_mod_page_attachments_alter dans advagg_mod/advagg_mod.module
Implements hook_page_attachments_alter().
InitSubscriber::deferCss dans advagg_mod/src/EventSubscriber/InitSubscriber.php
Apply CSS defer actions.

Fichier

advagg_mod/advagg_mod.module, line 225

Code

function advagg_mod_css_defer_active() {
    $config = \Drupal::config('advagg_mod.settings');
    if (!$config->get('css_defer')) {
        return FALSE;
    }
    $admin_route = \Drupal::service('router.admin_context')->isAdminRoute();
    if ($admin_route && !$config->get('css_defer_admin')) {
        return FALSE;
    }
    return TRUE;
}