Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krishna19/81b6142126dc9ed4498e2d988bfa1231 to your computer and use it in GitHub Desktop.
Save krishna19/81b6142126dc9ed4498e2d988bfa1231 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