\n"; } /** * Enqueues a Javascript file for loading in the head * * @param string $url The URL of the Javascript file to load */ public static function enqueueHeadScript($url) { if (in_array($url, self::$loadedScripts)) { return; } self::$loadedScripts[] = $url; if (!defined('AKEEBA_VERSION')) { @include_once dirname(self::$absoluteFileName) . '/app/version.php'; } $handle = 'akjs' . md5($url); $dependencies = array('jquery', 'jquery-migrate'); // When we override the loading of jQuery do not depend on WP's jQuery being loaded if (defined('AKEEBA_OVERRIDE_JQUERY') && AKEEBA_OVERRIDE_JQUERY) { $dependencies = array(); } wp_enqueue_script($handle, $url, $dependencies, AKEEBA_VERSION, false); } /** * Enqueues a CSS file for loading * * @param string $url The URL of the CSS file to load */ public static function enqueueStyle($url) { if (!defined('AKEEBA_VERSION')) { @include_once dirname(self::$absoluteFileName) . '/app/version.php'; } $handle = 'akcss' . md5($url); wp_enqueue_style($handle, $url, array(), AKEEBA_VERSION); } }