Created
February 25, 2014 03:06
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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