our asset to its list • WordPress will use best practices to include our asset • WordPress will use the information that we pass into functions to include assets
Core array( 'jquery', 'my-other-script' ) • List of included scripts: https://developer.wordpress.org/reference/functions/wp_enqueue_script/ • Don’t enqueue your own jQuery!
environments • Instead, use static versioning (Ex: 20181103.1100) • Static versioning is more explicit • WordPress will do this to break browser caching: <link href="main.css?ver=20181103.1100">
the footer in the markup false - Place JavaScript file call in the head in the markup • Always true, unless any of these conditions are met: ◦ Is there a script placed in the header that relies on this script? ◦ Is this mission-critical and should it be placed before the body renders.
• If you use this in a parent theme, it will reference a child theme if active • Does not include a trailing slash https://test.com/wp-content/themes/child-theme
parent theme. • If you use this function within a child theme, this will reference the root of its parent theme • Does not include a trailing slash https://test.com/wp-content/themes/parent-theme
a must-use plugin) • You can pass it the magic constant __FILE__ (two underscores) to get the directory of the current file plugin_dir_url( __FILE__ );