You are here

function advagg_mod_css_defer_active in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.4 advagg_mod/advagg_mod.module \advagg_mod_css_defer_active()
  2. 8.2 advagg_mod/advagg_mod.module \advagg_mod_css_defer_active()

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

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

File

advagg_mod/advagg_mod.module, line 225
Advanced aggregation modifier module.

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;
}