Load WP’s default JS asynchronously inside other JS file
-
So, instead of multiple wp_enqueue_script() functions I would like to asynchronously load, for example, the jQuery UI that comes with WordPress, in my custom JS file using $.getScript. For this, I would need to output the path to that file (which, according to the Codex is “/wp-includes/js/jquery/ui/jquery.ui.core.min.js”) into a JS variable in my template header. Is this possible, and if yes, how?
Edit: To clarify, I would like to output that path using some kind of dynamic variable, not hard-code it. So, something like
get_template_directory_uri()
but for the wp-includes directory.
- The topic ‘Load WP’s default JS asynchronously inside other JS file’ is closed to new replies.