Skip to content

Instantly share code, notes, and snippets.

@hasinhayder
Last active March 4, 2016 15:59
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save hasinhayder/87d171ceebf6066d944e to your computer and use it in GitHub Desktop.
Save hasinhayder/87d171ceebf6066d944e to your computer and use it in GitHub Desktop.
generate wp_enqueue_script calls for all the js files in the current directory
#!/usr/bin/env php
<?php
foreach(glob("*.js") as $js){
echo "wp_enqueue_script( 'wptheme-{$js}', get_template_directory_uri().'/js/{$js}', array('jquery'),'1.0',true);\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment