Skip to content

Instantly share code, notes, and snippets.

@palimadra
Created August 21, 2015 09:12
Show Gist options
  • Save palimadra/4bbb46a185c0dce28ebc to your computer and use it in GitHub Desktop.
Save palimadra/4bbb46a185c0dce28ebc to your computer and use it in GitHub Desktop.
How to properly enqueue stuff in WordPress
add_action( 'wp_enqueue_scripts', 'my_enqueued_assets' );
function my_enqueued_assets() {
wp_enqueue_script( 'my-script', plugin_dir_url( __FILE__ ) . '/js/my-script.js', array( 'jquery' ), '1.0', true );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment