You are here

function hook_slick_attach_load_info_alter in Slick Carousel 7.2

Alter Slick load information before they are called.

This function lives in a module file, not my_module.slick.inc.

Parameters

array $load: The modified array of $load information.

array $attach: The contextual array of $attach information.

array $skins: The contextual array of $skins information.

array $settings: An array of settings to check for the supported features.

See also

slick_attach()

slick_example.module

slick_devel.module

1 invocation of hook_slick_attach_load_info_alter()
slick_attach in ./slick.module
Returns the fully cached JS and CSS assets for the given slick.

File

./slick.api.php, line 364
Hooks and API provided by the Slick module.

Code

function hook_slick_attach_load_info_alter(array &$load, array $attach = [], array $skins = [], array $settings = []) {
  $slick_path = drupal_get_path('module', 'slick');
  $min = $slick_path . '/js/slick.load.min.js';
  $dev = $slick_path . '/js/slick.load.js';
  if (MYMODULE_DEBUG) {

    // Switch to the non-minified version of the slick.load.min.js.
    $load['js'] += array(
      $dev => array(
        'group' => JS_DEFAULT,
        'weight' => 0,
      ),
    );
    if (isset($load['js'][$min])) {
      unset($load['js'][$min]);
    }
  }
}