The component that enqueues this file is found under the “inc” folder and “Accessibility”.
The component first calls the initialize function and triggers
wp_enqueue_scripts(), and points to a custom function. Apart from the initialize function, this is the standard way of calling
wp_enqueue_scripts() and calling in custom scripts and invocations. The only difference is that in WP Rig, this is placed inside the component. In other themes, it’s usually placed inside the functions.php file in a long list.
action_enqueue_navigation_script() function that was just called with the
add action() call contains the standard
wp_enqueue_scripts() invocation. Here we used
wp_enqueue_scripts() exactly how you would always use it.
“Async” and “defer” allow us to load script files in the
<head> section of the document, and then either tell the browser to run the script asynchronously (when the file is fully loaded), or defer running the script until everything else is in place.
WP Rig has custom functionality allowing you to declare either “async” or “defer” for each individual script you enqueue. So you can choose exactly what you want to happen to each individual script.
This is cutting edge and not yet supported in WordPress, but this code will be supported at some point in the future, and you will not run into any conflicts.