Skip to content

Instantly share code, notes, and snippets.

@mathetos
Created July 22, 2014 04:45
Show Gist options
  • Save mathetos/6c4d3dc77ee3591e0a74 to your computer and use it in GitHub Desktop.
Save mathetos/6c4d3dc77ee3591e0a74 to your computer and use it in GitHub Desktop.
Admin Enqueue Iris.js
<?php
function load_mc_iris() {
if (wp_script_is( 'iris', 'enqueued' )) {
return; // if it's already enqueued, don't enqueue it again.
} else { // since it's NOT enqueued, let's enqueue it
wp_enqueue_script(
'iris', //iris.js handle
admin_url( 'js/iris.min.js' ), //path to wordpress iris file
array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), //these must load BEFORE iris (i.e. "dependencies)
false, // don't load it in the footer
1 // priority
);
}
}
// add this only on the backend
add_action( 'admin_enqueue_scripts', 'load_mc_iris' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment