You are here

function magnific_popup_library_info_alter in Magnific Popup 8

Same name and namespace in other branches
  1. 8.2 magnific_popup.module \magnific_popup_library_info_alter()

Implements hook_library_info_alter().

Used to maintain backwards compatibility with the legacy library path used in the early versions of the module.

File

./magnific_popup.module, line 14
Magnific popup module file for hooks and global methods.

Code

function magnific_popup_library_info_alter(&$libraries, $extension) {
  if ($extension === 'magnific_popup' && _magnific_popup_use_legacy_path()) {
    if (isset($libraries['magnific_popup']['js']['/libraries/magnific-popup/dist/jquery.magnific-popup.min.js'])) {
      $libraries['magnific_popup']['js']['/libraries/magnific-popup/jquery.magnific-popup.min.js'] = $libraries['magnific_popup']['js']['/libraries/magnific-popup/dist/jquery.magnific-popup.min.js'];
      unset($libraries['magnific_popup']['js']['/libraries/magnific-popup/dist/jquery.magnific-popup.min.js']);
    }
    if (isset($libraries['magnific_popup']['css']['base']['/libraries/magnific-popup/dist/magnific-popup.css'])) {
      $libraries['magnific_popup']['css']['base']['/libraries/magnific-popup/magnific-popup.css'] = $libraries['magnific_popup']['css']['base']['/libraries/magnific-popup/dist/magnific-popup.css'];
      unset($libraries['magnific_popup']['css']['base']['/libraries/magnific-popup/dist/magnific-popup.css']);
    }
  }
}