Skip to content

Instantly share code, notes, and snippets.

@pdewouters
Created November 28, 2011 10:47
Show Gist options
  • Save pdewouters/1399949 to your computer and use it in GitHub Desktop.
Save pdewouters/1399949 to your computer and use it in GitHub Desktop.
enqueue scripts in plugin the right way
// guess current plugin directory URL
$plugin_url = plugin_dir_url(__FILE__);
//enqueue script
wp_enqueue_script('wpc_script', $plugin_url . 'js/script.js');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment