Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created February 25, 2014 03:06
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pippinsplugins/9201867 to your computer and use it in GitHub Desktop.
Save pippinsplugins/9201867 to your computer and use it in GitHub Desktop.
Simple example of how to use SCRIPT_DEBUG to load non-minified assets
<?php
// Use minified libraries if SCRIPT_DEBUG is turned off
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_enqueue_script( 'my-script-handle', plugin_dir_url( __FILE__ ) . 'assets/my-file' . $suffix . '.js', array( 'jquery' ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment