do_concat = true; } /** * Wordpress has no ability to hook into script queuing, so this is a work around **/ function filter_queue_script($src, $handle) { global $wp_scripts; self::$depends[$handle] = array( 'src' => $src, 'deps' => $wp_scripts->registered[$handle]->deps ); } /** * Outputs headjs code in header or footer **/ function filter_headjs(){ if(count(self::$depends) > 0){ if(!self::$head_loaded){ echo ''; self::$head_loaded = true; } $handles = array(); foreach(self::$depends as $handle => $depend){ $handles[] = '{"' . $handle . '": "' . $depend['src'] . '"}'; } echo ''; self::$depends = array(); } return false; // prevent printing of javascript } } AsynchronousJS::init(); ?>