Created
July 22, 2014 04:45
-
-
Save mathetos/6c4d3dc77ee3591e0a74 to your computer and use it in GitHub Desktop.
Admin Enqueue Iris.js
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 | |
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